From d16987283a51693d42ef723e328b1255fb9be81e Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Mon, 4 Jun 2012 11:16:25 +0000 Subject: [PATCH] Import libreoffice_3.5.4.orig-binfilter.tar.xz [dgit import orig libreoffice_3.5.4.orig-binfilter.tar.xz] --- bf_basic/source/basmgr/basmgr.cxx | 2254 +++++++ bf_basic/source/basmgr/makefile.mk | 49 + bf_basic/source/classes/image.cxx | 282 + bf_basic/source/classes/makefile.mk | 59 + bf_basic/source/classes/sb.cxx | 1346 ++++ bf_basic/source/classes/sbintern.cxx | 78 + bf_basic/source/classes/sbunoobj.cxx | 2537 ++++++++ bf_basic/source/classes/sbxmod.cxx | 750 +++ bf_basic/source/comp/buffer.cxx | 172 + bf_basic/source/comp/codegen.cxx | 230 + bf_basic/source/comp/makefile.mk | 55 + bf_basic/source/comp/parser.cxx | 865 +++ bf_basic/source/comp/sbcomp.cxx | 54 + bf_basic/source/comp/scanner.cxx | 538 ++ bf_basic/source/comp/token.cxx | 410 ++ bf_basic/source/inc/buffer.hxx | 66 + bf_basic/source/inc/codegen.hxx | 72 + bf_basic/source/inc/filefmt.hxx | 185 + bf_basic/source/inc/image.hxx | 107 + bf_basic/source/inc/opcodes.hxx | 164 + bf_basic/source/inc/sbintern.hxx | 141 + bf_basic/source/inc/sbjsmeth.hxx | 60 + bf_basic/source/inc/sbjsmod.hxx | 54 + bf_basic/source/inc/sbunoobj.hxx | 250 + bf_basic/source/inc/scanner.hxx | 147 + bf_basic/source/inc/token.hxx | 159 + bf_basic/source/runtime/basrdll.cxx | 47 + bf_basic/source/runtime/makefile.mk | 48 + bf_basic/source/sbx/makefile.mk | 77 + bf_basic/source/sbx/sbxarray.cxx | 745 +++ bf_basic/source/sbx/sbxbase.cxx | 365 ++ bf_basic/source/sbx/sbxbool.cxx | 251 + bf_basic/source/sbx/sbxbyte.cxx | 333 + bf_basic/source/sbx/sbxchar.cxx | 323 + bf_basic/source/sbx/sbxcoll.cxx | 293 + bf_basic/source/sbx/sbxconv.hxx | 158 + bf_basic/source/sbx/sbxcurr.cxx | 398 ++ bf_basic/source/sbx/sbxdate.cxx | 416 ++ bf_basic/source/sbx/sbxdbl.cxx | 301 + bf_basic/source/sbx/sbxdec.cxx | 731 +++ bf_basic/source/sbx/sbxdec.hxx | 127 + bf_basic/source/sbx/sbxexec.cxx | 335 + bf_basic/source/sbx/sbxint.cxx | 970 +++ bf_basic/source/sbx/sbxlng.cxx | 345 ++ bf_basic/source/sbx/sbxobj.cxx | 854 +++ bf_basic/source/sbx/sbxres.cxx | 94 + bf_basic/source/sbx/sbxres.hxx | 95 + bf_basic/source/sbx/sbxscan.cxx | 518 ++ bf_basic/source/sbx/sbxsng.cxx | 358 ++ bf_basic/source/sbx/sbxstr.cxx | 246 + bf_basic/source/sbx/sbxuint.cxx | 335 + bf_basic/source/sbx/sbxulng.cxx | 320 + bf_basic/source/sbx/sbxvalue.cxx | 1591 +++++ bf_basic/source/sbx/sbxvar.cxx | 495 ++ bf_basic/util/makefile.mk | 88 + bf_forms/source/component/BaseListBox.hxx | 47 + bf_forms/source/component/Button.hxx | 128 + bf_forms/source/component/CheckBox.hxx | 131 + bf_forms/source/component/Columns.hxx | 224 + bf_forms/source/component/ComboBox.hxx | 149 + bf_forms/source/component/Currency.hxx | 103 + bf_forms/source/component/DatabaseForm.hxx | 485 ++ bf_forms/source/component/Date.hxx | 115 + bf_forms/source/component/Edit.hxx | 167 + bf_forms/source/component/EditBase.hxx | 112 + bf_forms/source/component/EventThread.hxx | 127 + bf_forms/source/component/File.hxx | 109 + bf_forms/source/component/Filter.hxx | 153 + bf_forms/source/component/FixedText.hxx | 82 + bf_forms/source/component/FormComponent.hxx | 486 ++ bf_forms/source/component/FormattedField.hxx | 199 + .../component/FormattedFieldWrapper.hxx | 100 + bf_forms/source/component/FormsCollection.hxx | 100 + bf_forms/source/component/Grid.hxx | 225 + bf_forms/source/component/GroupBox.hxx | 95 + bf_forms/source/component/GroupManager.hxx | 230 + bf_forms/source/component/Hidden.hxx | 95 + bf_forms/source/component/Image.hxx | 230 + bf_forms/source/component/ImageButton.hxx | 118 + bf_forms/source/component/ImageControl.hxx | 185 + bf_forms/source/component/ListBox.hxx | 199 + bf_forms/source/component/Numeric.hxx | 101 + bf_forms/source/component/Pattern.hxx | 102 + bf_forms/source/component/RadioButton.hxx | 131 + bf_forms/source/component/Time.hxx | 115 + bf_forms/source/component/cloneable.hxx | 59 + .../source/component/errorbroadcaster.hxx | 76 + bf_forms/source/component/forms_Button.cxx | 409 ++ bf_forms/source/component/forms_CheckBox.cxx | 353 ++ bf_forms/source/component/forms_Columns.cxx | 629 ++ bf_forms/source/component/forms_ComboBox.cxx | 476 ++ bf_forms/source/component/forms_Currency.cxx | 240 + .../source/component/forms_DatabaseForm.cxx | 3867 ++++++++++++ bf_forms/source/component/forms_Date.cxx | 242 + bf_forms/source/component/forms_Edit.cxx | 517 ++ bf_forms/source/component/forms_EditBase.cxx | 412 ++ .../source/component/forms_EventThread.cxx | 243 + bf_forms/source/component/forms_File.cxx | 301 + bf_forms/source/component/forms_Filter.cxx | 641 ++ bf_forms/source/component/forms_FixedText.cxx | 161 + .../source/component/forms_FormComponent.cxx | 1400 +++++ .../source/component/forms_FormattedField.cxx | 912 +++ .../component/forms_FormattedFieldWrapper.cxx | 407 ++ .../component/forms_FormsCollection.cxx | 166 + bf_forms/source/component/forms_Grid.cxx | 1347 ++++ bf_forms/source/component/forms_GroupBox.cxx | 202 + .../source/component/forms_GroupManager.cxx | 465 ++ bf_forms/source/component/forms_Hidden.cxx | 209 + bf_forms/source/component/forms_Image.cxx | 904 +++ .../source/component/forms_ImageButton.cxx | 290 + .../source/component/forms_ImageControl.cxx | 646 ++ bf_forms/source/component/forms_ListBox.cxx | 726 +++ bf_forms/source/component/forms_Numeric.cxx | 190 + bf_forms/source/component/forms_Pattern.cxx | 192 + .../source/component/forms_RadioButton.cxx | 473 ++ bf_forms/source/component/forms_Time.cxx | 251 + bf_forms/source/component/forms_cloneable.cxx | 71 + .../component/forms_errorbroadcaster.cxx | 104 + bf_forms/source/component/forms_imgprod.cxx | 663 ++ bf_forms/source/component/imgprod.hxx | 128 + bf_forms/source/component/makefile.mk | 120 + bf_forms/source/inc/InterfaceContainer.hxx | 299 + bf_forms/source/inc/formsmodule.hxx | 207 + bf_forms/source/inc/frm_resource.hrc | 61 + bf_forms/source/inc/frm_resource.hxx | 81 + bf_forms/source/inc/ids.hxx | 40 + bf_forms/source/inc/limitedformats.hxx | 108 + bf_forms/source/inc/property.hrc | 405 ++ bf_forms/source/inc/property.hxx | 209 + bf_forms/source/inc/services.hxx | 213 + bf_forms/source/inc/strings.hxx | 88 + .../source/misc/forms_InterfaceContainer.cxx | 1094 ++++ bf_forms/source/misc/forms_formsmodule.cxx | 188 + bf_forms/source/misc/forms_ids.cxx | 38 + bf_forms/source/misc/forms_limitedformats.cxx | 406 ++ bf_forms/source/misc/forms_property.cxx | 444 ++ bf_forms/source/misc/forms_services.cxx | 532 ++ bf_forms/source/misc/makefile.mk | 59 + .../source/resource/forms_frm_resource.cxx | 90 + bf_forms/source/resource/forms_strings.src | 531 ++ bf_forms/source/resource/makefile.mk | 52 + bf_forms/util/bf_frm.component | 203 + bf_forms/util/frm.dxp | 1 + bf_forms/util/frm.xml | 479 ++ bf_forms/util/makefile.mk | 149 + .../source/base2d/goodies_graphicobject.cxx | 76 + bf_goodies/source/base2d/goodies_matrix3d.cxx | 484 ++ bf_goodies/source/base2d/goodies_point3d.cxx | 446 ++ bf_goodies/source/base2d/makefile.mk | 50 + bf_goodies/source/base3d/goodies_b3dcolor.cxx | 261 + bf_goodies/source/base3d/goodies_b3dcompo.cxx | 1192 ++++ bf_goodies/source/base3d/goodies_b3dentty.cxx | 154 + bf_goodies/source/base3d/goodies_b3dgeom.cxx | 852 +++ bf_goodies/source/base3d/goodies_b3dlight.cxx | 452 ++ bf_goodies/source/base3d/goodies_b3dtrans.cxx | 618 ++ bf_goodies/source/base3d/goodies_b3dvolum.cxx | 148 + bf_goodies/source/base3d/goodies_hmatrix.cxx | 969 +++ bf_goodies/source/base3d/goodies_matril3d.cxx | 80 + bf_goodies/source/base3d/goodies_point4d.cxx | 552 ++ bf_goodies/source/base3d/goodies_vector3d.cxx | 490 ++ bf_goodies/source/base3d/makefile.mk | 58 + bf_goodies/util/makefile.mk | 81 + bf_offmgr/source/offapp/app/makefile.mk | 61 + bf_offmgr/source/offapp/app/offmgr_app.cxx | 172 + bf_offmgr/util/makefile.mk | 135 + bf_offmgr/util/makefile.pmk | 27 + bf_sc/source/core/data/makefile.mk | 109 + bf_sc/source/core/data/sc_attarray.cxx | 1598 +++++ bf_sc/source/core/data/sc_attrib.cxx | 970 +++ bf_sc/source/core/data/sc_bcaslot.cxx | 577 ++ bf_sc/source/core/data/sc_bclist.cxx | 187 + bf_sc/source/core/data/sc_cell.cxx | 1486 +++++ bf_sc/source/core/data/sc_cell2.cxx | 819 +++ bf_sc/source/core/data/sc_column.cxx | 1290 ++++ bf_sc/source/core/data/sc_column2.cxx | 1531 +++++ bf_sc/source/core/data/sc_column3.cxx | 1058 ++++ bf_sc/source/core/data/sc_conditio.cxx | 1267 ++++ bf_sc/source/core/data/sc_dbdocutl.cxx | 195 + bf_sc/source/core/data/sc_dociter.cxx | 963 +++ bf_sc/source/core/data/sc_docpool.cxx | 607 ++ bf_sc/source/core/data/sc_documen2.cxx | 1078 ++++ bf_sc/source/core/data/sc_documen3.cxx | 801 +++ bf_sc/source/core/data/sc_documen4.cxx | 456 ++ bf_sc/source/core/data/sc_documen5.cxx | 449 ++ bf_sc/source/core/data/sc_documen6.cxx | 163 + bf_sc/source/core/data/sc_documen7.cxx | 399 ++ bf_sc/source/core/data/sc_documen8.cxx | 465 ++ bf_sc/source/core/data/sc_documen9.cxx | 452 ++ bf_sc/source/core/data/sc_document.cxx | 2643 ++++++++ bf_sc/source/core/data/sc_dpobject.cxx | 849 +++ bf_sc/source/core/data/sc_dpoutput.cxx | 117 + bf_sc/source/core/data/sc_dpsave.cxx | 780 +++ bf_sc/source/core/data/sc_dpshttab.cxx | 200 + bf_sc/source/core/data/sc_dptabdat.cxx | 67 + bf_sc/source/core/data/sc_dptabsrc.cxx | 1118 ++++ bf_sc/source/core/data/sc_drawpage.cxx | 70 + bf_sc/source/core/data/sc_drwlayer.cxx | 878 +++ bf_sc/source/core/data/sc_fillinfo.cxx | 86 + bf_sc/source/core/data/sc_global.cxx | 783 +++ bf_sc/source/core/data/sc_global2.cxx | 1307 ++++ bf_sc/source/core/data/sc_globalx.cxx | 137 + bf_sc/source/core/data/sc_markarr.cxx | 412 ++ bf_sc/source/core/data/sc_markdata.cxx | 369 ++ bf_sc/source/core/data/sc_olinetab.cxx | 566 ++ bf_sc/source/core/data/sc_pagepar.cxx | 114 + bf_sc/source/core/data/sc_patattr.cxx | 1156 ++++ bf_sc/source/core/data/sc_pivot.cxx | 1213 ++++ bf_sc/source/core/data/sc_pivot2.cxx | 275 + bf_sc/source/core/data/sc_poolhelp.cxx | 91 + bf_sc/source/core/data/sc_sortparam.cxx | 98 + bf_sc/source/core/data/sc_stlpool.cxx | 556 ++ bf_sc/source/core/data/sc_stlsheet.cxx | 311 + bf_sc/source/core/data/sc_table1.cxx | 770 +++ bf_sc/source/core/data/sc_table2.cxx | 1707 ++++++ bf_sc/source/core/data/sc_table3.cxx | 363 ++ bf_sc/source/core/data/sc_table4.cxx | 116 + bf_sc/source/core/data/sc_table5.cxx | 373 ++ bf_sc/source/core/data/sc_userdat.cxx | 393 ++ bf_sc/source/core/data/sc_validat.cxx | 243 + bf_sc/source/core/inc/addinhelpid.hxx | 63 + bf_sc/source/core/inc/addinlis.hxx | 105 + bf_sc/source/core/inc/adiasync.hxx | 95 + bf_sc/source/core/inc/bcaslot.hxx | 158 + bf_sc/source/core/inc/ddelink.hxx | 91 + bf_sc/source/core/inc/interpre.hxx | 722 +++ bf_sc/source/core/inc/poolhelp.hxx | 70 + bf_sc/source/core/inc/refupdat.hxx | 77 + bf_sc/source/core/inc/scmatrix.hxx | 184 + bf_sc/source/core/inc/scrdata.hxx | 53 + bf_sc/source/core/src/makefile.mk | 50 + bf_sc/source/core/src/sc_compiler.src | Bin 0 -> 249936 bytes bf_sc/source/core/tool/makefile.mk | 106 + bf_sc/source/core/tool/sc_addincol.cxx | 1103 ++++ bf_sc/source/core/tool/sc_addinhelpid.cxx | 221 + bf_sc/source/core/tool/sc_addinlis.cxx | 178 + bf_sc/source/core/tool/sc_adiasync.cxx | 142 + bf_sc/source/core/tool/sc_appoptio.cxx | 674 ++ bf_sc/source/core/tool/sc_autoform.cxx | 726 +++ bf_sc/source/core/tool/sc_callform.cxx | 269 + bf_sc/source/core/tool/sc_cellform.cxx | 215 + bf_sc/source/core/tool/sc_chartarr.cxx | 1168 ++++ bf_sc/source/core/tool/sc_chartlis.cxx | 312 + bf_sc/source/core/tool/sc_chgtrack.cxx | 3686 +++++++++++ bf_sc/source/core/tool/sc_chgviset.cxx | 134 + bf_sc/source/core/tool/sc_collect.cxx | 323 + bf_sc/source/core/tool/sc_compiler.cxx | 3236 ++++++++++ bf_sc/source/core/tool/sc_consoli.cxx | 534 ++ bf_sc/source/core/tool/sc_dbcolect.cxx | 800 +++ bf_sc/source/core/tool/sc_ddelink.cxx | 131 + bf_sc/source/core/tool/sc_detdata.cxx | 120 + bf_sc/source/core/tool/sc_detfunc.cxx | 1649 +++++ bf_sc/source/core/tool/sc_docoptio.cxx | 377 ++ bf_sc/source/core/tool/sc_editutil.cxx | 501 ++ bf_sc/source/core/tool/sc_hints.cxx | 112 + bf_sc/source/core/tool/sc_indexmap.cxx | 67 + bf_sc/source/core/tool/sc_inputopt.cxx | 267 + bf_sc/source/core/tool/sc_interpr1.cxx | 5400 +++++++++++++++++ bf_sc/source/core/tool/sc_interpr2.cxx | 2142 +++++++ bf_sc/source/core/tool/sc_interpr3.cxx | 3566 +++++++++++ bf_sc/source/core/tool/sc_interpr4.cxx | 3230 ++++++++++ bf_sc/source/core/tool/sc_interpr5.cxx | 4058 +++++++++++++ bf_sc/source/core/tool/sc_interpr6.cxx | 111 + bf_sc/source/core/tool/sc_optutil.cxx | 75 + bf_sc/source/core/tool/sc_printopt.cxx | 94 + bf_sc/source/core/tool/sc_prnsave.cxx | 122 + bf_sc/source/core/tool/sc_progress.cxx | 118 + bf_sc/source/core/tool/sc_rangelst.cxx | 503 ++ bf_sc/source/core/tool/sc_rangenam.cxx | 487 ++ bf_sc/source/core/tool/sc_rangeseq.cxx | 342 ++ bf_sc/source/core/tool/sc_rangeutl.cxx | 236 + bf_sc/source/core/tool/sc_rechead.cxx | 217 + bf_sc/source/core/tool/sc_refdata.cxx | 261 + bf_sc/source/core/tool/sc_refreshtimer.cxx | 67 + bf_sc/source/core/tool/sc_refupdat.cxx | 759 +++ bf_sc/source/core/tool/sc_scmatrix.cxx | 517 ++ bf_sc/source/core/tool/sc_subtotal.cxx | 144 + bf_sc/source/core/tool/sc_token.cxx | 1634 +++++ bf_sc/source/core/tool/sc_unitconv.cxx | 169 + bf_sc/source/core/tool/sc_userlist.cxx | 221 + bf_sc/source/core/tool/sc_viewopti.cxx | 607 ++ bf_sc/source/core/tool/sc_zforauto.cxx | 74 + .../xml/XMLCalculationSettingsContext.hxx | 117 + .../filter/xml/XMLCellRangeSourceContext.hxx | 84 + .../xml/XMLChangeTrackingExportHelper.hxx | 107 + .../xml/XMLChangeTrackingImportHelper.hxx | 251 + .../filter/xml/XMLColumnRowGroupExport.hxx | 80 + .../filter/xml/XMLConsolidationContext.hxx | 77 + bf_sc/source/filter/xml/XMLConverter.hxx | 233 + .../source/filter/xml/XMLDDELinksContext.hxx | 237 + .../source/filter/xml/XMLDetectiveContext.hxx | 183 + bf_sc/source/filter/xml/XMLEmptyContext.hxx | 62 + bf_sc/source/filter/xml/XMLExportDDELinks.hxx | 58 + .../source/filter/xml/XMLExportDataPilot.hxx | 60 + .../filter/xml/XMLExportDatabaseRanges.hxx | 64 + bf_sc/source/filter/xml/XMLExportIterator.hxx | 381 ++ .../source/filter/xml/XMLExportSharedData.hxx | 92 + .../filter/xml/XMLStylesExportHelper.hxx | 302 + .../filter/xml/XMLStylesImportHelper.hxx | 205 + .../xml/XMLTableHeaderFooterContext.hxx | 120 + .../filter/xml/XMLTableMasterPageExport.hxx | 72 + .../filter/xml/XMLTableShapeImportHelper.hxx | 62 + .../filter/xml/XMLTableShapeResizer.hxx | 87 + .../filter/xml/XMLTableShapesContext.hxx | 60 + .../filter/xml/XMLTableSourceContext.hxx | 69 + bf_sc/source/filter/xml/XMLTextPContext.hxx | 76 + .../filter/xml/XMLTrackedChangesContext.hxx | 68 + bf_sc/source/filter/xml/makefile.mk | 145 + .../xml/sc_XMLCalculationSettingsContext.cxx | 292 + .../xml/sc_XMLCellRangeSourceContext.cxx | 140 + .../xml/sc_XMLChangeTrackingExportHelper.cxx | 783 +++ .../xml/sc_XMLChangeTrackingImportHelper.cxx | 842 +++ .../filter/xml/sc_XMLColumnRowGroupExport.cxx | 185 + .../filter/xml/sc_XMLConsolidationContext.cxx | 165 + bf_sc/source/filter/xml/sc_XMLConverter.cxx | 724 +++ .../filter/xml/sc_XMLDDELinksContext.cxx | 442 ++ .../filter/xml/sc_XMLDetectiveContext.cxx | 269 + .../source/filter/xml/sc_XMLEmptyContext.cxx | 67 + .../filter/xml/sc_XMLExportDDELinks.cxx | 209 + .../filter/xml/sc_XMLExportDataPilot.cxx | 473 ++ .../filter/xml/sc_XMLExportDatabaseRanges.cxx | 767 +++ .../filter/xml/sc_XMLExportIterator.cxx | 720 +++ .../filter/xml/sc_XMLExportSharedData.cxx | 150 + .../filter/xml/sc_XMLStylesExportHelper.cxx | 1192 ++++ .../filter/xml/sc_XMLStylesImportHelper.cxx | 585 ++ .../xml/sc_XMLTableHeaderFooterContext.cxx | 298 + .../xml/sc_XMLTableMasterPageExport.cxx | 195 + .../xml/sc_XMLTableShapeImportHelper.cxx | 168 + .../filter/xml/sc_XMLTableShapeResizer.cxx | 348 ++ .../filter/xml/sc_XMLTableShapesContext.cxx | 91 + .../filter/xml/sc_XMLTableSourceContext.cxx | 152 + .../source/filter/xml/sc_XMLTextPContext.cxx | 176 + .../xml/sc_XMLTrackedChangesContext.cxx | 2024 ++++++ bf_sc/source/filter/xml/sc_xmlannoi.cxx | 145 + bf_sc/source/filter/xml/sc_xmlbodyi.cxx | 232 + bf_sc/source/filter/xml/sc_xmlcelli.cxx | 1043 ++++ bf_sc/source/filter/xml/sc_xmlcoli.cxx | 312 + bf_sc/source/filter/xml/sc_xmlconti.cxx | 107 + bf_sc/source/filter/xml/sc_xmlcvali.cxx | 738 +++ bf_sc/source/filter/xml/sc_xmldpimp.cxx | 1032 ++++ bf_sc/source/filter/xml/sc_xmldrani.cxx | 923 +++ bf_sc/source/filter/xml/sc_xmlexprt.cxx | 3195 ++++++++++ bf_sc/source/filter/xml/sc_xmlfilti.cxx | 785 +++ bf_sc/source/filter/xml/sc_xmlfonte.cxx | 153 + bf_sc/source/filter/xml/sc_xmlimprt.cxx | 2201 +++++++ bf_sc/source/filter/xml/sc_xmllabri.cxx | 167 + bf_sc/source/filter/xml/sc_xmlnexpi.cxx | 332 + bf_sc/source/filter/xml/sc_xmlrowi.cxx | 355 ++ bf_sc/source/filter/xml/sc_xmlsceni.cxx | 167 + bf_sc/source/filter/xml/sc_xmlsorti.cxx | 306 + bf_sc/source/filter/xml/sc_xmlstyle.cxx | 1556 +++++ bf_sc/source/filter/xml/sc_xmlstyli.cxx | 1007 +++ bf_sc/source/filter/xml/sc_xmlsubti.cxx | 744 +++ bf_sc/source/filter/xml/sc_xmltabi.cxx | 268 + bf_sc/source/filter/xml/xmlannoi.hxx | 76 + bf_sc/source/filter/xml/xmlbodyi.hxx | 64 + bf_sc/source/filter/xml/xmlcelli.hxx | 143 + bf_sc/source/filter/xml/xmlcoli.hxx | 99 + bf_sc/source/filter/xml/xmlconti.hxx | 69 + bf_sc/source/filter/xml/xmlcvali.hxx | 67 + bf_sc/source/filter/xml/xmldpimp.hxx | 443 ++ bf_sc/source/filter/xml/xmldrani.hxx | 328 + bf_sc/source/filter/xml/xmlexprt.hxx | 252 + bf_sc/source/filter/xml/xmlfilti.hxx | 313 + bf_sc/source/filter/xml/xmlimprt.hxx | 926 +++ bf_sc/source/filter/xml/xmllabri.hxx | 95 + bf_sc/source/filter/xml/xmlnexpi.hxx | 108 + bf_sc/source/filter/xml/xmlrowi.hxx | 99 + bf_sc/source/filter/xml/xmlsceni.hxx | 77 + bf_sc/source/filter/xml/xmlsorti.hxx | 111 + bf_sc/source/filter/xml/xmlstyle.hxx | 336 + bf_sc/source/filter/xml/xmlstyli.hxx | 297 + bf_sc/source/filter/xml/xmlsubti.hxx | 175 + bf_sc/source/filter/xml/xmltabi.hxx | 66 + bf_sc/source/ui/app/makefile.mk | 75 + bf_sc/source/ui/app/sc_msgpool.cxx | 128 + bf_sc/source/ui/app/sc_rfindlst.cxx | 52 + bf_sc/source/ui/app/sc_scdll.cxx | 136 + bf_sc/source/ui/app/sc_sclib.cxx | 591 ++ bf_sc/source/ui/app/sc_scmod.cxx | 395 ++ bf_sc/source/ui/app/sc_scmod2.cxx | 84 + bf_sc/source/ui/app/sc_uiitems.cxx | 350 ++ bf_sc/source/ui/dbgui/asciiopt.hrc | 55 + bf_sc/source/ui/dbgui/imoptdlg.hrc | 43 + bf_sc/source/ui/dbgui/makefile.mk | 59 + bf_sc/source/ui/dbgui/pivot.hrc | 73 + bf_sc/source/ui/dbgui/sc_asciiopt.cxx | 214 + bf_sc/source/ui/dbgui/sc_asciiopt.src | 66 + bf_sc/source/ui/dbgui/sc_imoptdlg.cxx | 72 + bf_sc/source/ui/dbgui/sc_imoptdlg.src | 43 + bf_sc/source/ui/dbgui/sc_outline.src | 37 + bf_sc/source/ui/dbgui/sc_pivot.src | 50 + bf_sc/source/ui/docshell/makefile.mk | 68 + bf_sc/source/ui/docshell/sc_arealink.cxx | 240 + bf_sc/source/ui/docshell/sc_dbdocfun.cxx | 355 ++ bf_sc/source/ui/docshell/sc_dbdocimp.cxx | 495 ++ bf_sc/source/ui/docshell/sc_docfunc.cxx | 1615 +++++ bf_sc/source/ui/docshell/sc_docsh.cxx | 1000 +++ bf_sc/source/ui/docshell/sc_docsh2.cxx | 257 + bf_sc/source/ui/docshell/sc_docsh3.cxx | 475 ++ bf_sc/source/ui/docshell/sc_docsh4.cxx | 180 + bf_sc/source/ui/docshell/sc_docsh5.cxx | 425 ++ bf_sc/source/ui/docshell/sc_docsh6.cxx | 312 + bf_sc/source/ui/docshell/sc_editable.cxx | 115 + bf_sc/source/ui/docshell/sc_impex.cxx | 568 ++ bf_sc/source/ui/docshell/sc_pntlock.cxx | 65 + bf_sc/source/ui/docshell/sc_sizedev.cxx | 81 + bf_sc/source/ui/docshell/sc_tablink.cxx | 405 ++ bf_sc/source/ui/inc/AccessibleContextBase.hxx | 338 ++ bf_sc/source/ui/inc/AccessibleText.hxx | 362 ++ bf_sc/source/ui/inc/asciiopt.hxx | 105 + bf_sc/source/ui/inc/autostyl.hxx | 49 + bf_sc/source/ui/inc/csvcontrol.hxx | 315 + bf_sc/source/ui/inc/csvgrid.hxx | 150 + bf_sc/source/ui/inc/csvruler.hxx | 93 + bf_sc/source/ui/inc/csvsplits.hxx | 68 + bf_sc/source/ui/inc/csvtablebox.hxx | 48 + bf_sc/source/ui/inc/dbdocfun.hxx | 96 + bf_sc/source/ui/inc/docfunc.hxx | 140 + bf_sc/source/ui/inc/docsh.hxx | 311 + bf_sc/source/ui/inc/editable.hxx | 86 + bf_sc/source/ui/inc/formdata.hxx | 52 + bf_sc/source/ui/inc/imoptdlg.hxx | 112 + bf_sc/source/ui/inc/impex.hxx | 126 + bf_sc/source/ui/inc/msgpool.hxx | 78 + bf_sc/source/ui/inc/namecrea.hxx | 66 + bf_sc/source/ui/inc/optload.hrc | 40 + bf_sc/source/ui/inc/pntlock.hxx | 71 + bf_sc/source/ui/inc/printfun.hxx | 279 + bf_sc/source/ui/inc/rfindlst.hxx | 72 + bf_sc/source/ui/inc/sizedev.hxx | 59 + bf_sc/source/ui/inc/teamdlg.hxx | 58 + bf_sc/source/ui/inc/tpcalc.hxx | 49 + bf_sc/source/ui/inc/tpusrlst.hxx | 53 + bf_sc/source/ui/inc/uiitems.hxx | 284 + bf_sc/source/ui/inc/undobase.hxx | 111 + bf_sc/source/ui/inc/undocell.hxx | 122 + bf_sc/source/ui/inc/undodat.hxx | 132 + bf_sc/source/ui/inc/undodraw.hxx | 57 + bf_sc/source/ui/inc/undotab.hxx | 161 + bf_sc/source/ui/inc/viewdata.hxx | 392 ++ bf_sc/source/ui/src/makefile.mk | 60 + bf_sc/source/ui/src/sc_globstr.src | 4003 ++++++++++++ bf_sc/source/ui/src/sc_pseudo.src | 252 + bf_sc/source/ui/src/sc_sc.src | 94 + bf_sc/source/ui/src/sc_scerrors.src | 530 ++ bf_sc/source/ui/src/sc_scstring.src | 1708 ++++++ bf_sc/source/ui/unoobj/makefile.mk | 79 + bf_sc/source/ui/unoobj/sc_afmtuno.cxx | 822 +++ bf_sc/source/ui/unoobj/sc_appluno.cxx | 886 +++ bf_sc/source/ui/unoobj/sc_cellsuno.cxx | Bin 0 -> 334133 bytes bf_sc/source/ui/unoobj/sc_chartuno.cxx | 605 ++ bf_sc/source/ui/unoobj/sc_confuno.cxx | 406 ++ bf_sc/source/ui/unoobj/sc_convuno.cxx | 69 + bf_sc/source/ui/unoobj/sc_cursuno.cxx | 483 ++ bf_sc/source/ui/unoobj/sc_dapiuno.cxx | 1834 ++++++ bf_sc/source/ui/unoobj/sc_datauno.cxx | 2043 +++++++ bf_sc/source/ui/unoobj/sc_defltuno.cxx | 385 ++ bf_sc/source/ui/unoobj/sc_docuno.cxx | 2496 ++++++++ bf_sc/source/ui/unoobj/sc_drdefuno.cxx | 87 + bf_sc/source/ui/unoobj/sc_editsrc.cxx | 352 ++ bf_sc/source/ui/unoobj/sc_fielduno.cxx | 1520 +++++ bf_sc/source/ui/unoobj/sc_filtuno.cxx | 241 + bf_sc/source/ui/unoobj/sc_fmtuno.cxx | 865 +++ bf_sc/source/ui/unoobj/sc_forbiuno.cxx | 97 + bf_sc/source/ui/unoobj/sc_funcuno.cxx | 713 +++ bf_sc/source/ui/unoobj/sc_linkuno.cxx | 1332 ++++ bf_sc/source/ui/unoobj/sc_miscuno.cxx | 377 ++ bf_sc/source/ui/unoobj/sc_nameuno.cxx | 926 +++ bf_sc/source/ui/unoobj/sc_notesuno.cxx | 307 + bf_sc/source/ui/unoobj/sc_optuno.cxx | 210 + bf_sc/source/ui/unoobj/sc_pageuno.cxx | 85 + bf_sc/source/ui/unoobj/sc_servuno.cxx | 297 + bf_sc/source/ui/unoobj/sc_shapeuno.cxx | 800 +++ bf_sc/source/ui/unoobj/sc_styleuno.cxx | 1906 ++++++ bf_sc/source/ui/unoobj/sc_textuno.cxx | 1144 ++++ bf_sc/source/ui/unoobj/sc_unodoc.cxx | 80 + bf_sc/source/ui/view/makefile.mk | 51 + bf_sc/source/ui/view/sc_printfun.cxx | 1018 ++++ bf_sc/source/ui/view/sc_viewdata.cxx | 538 ++ bf_sc/util/bf_sc.component | 82 + bf_sc/util/bf_sc.map | 10 + bf_sc/util/makefile.mk | 186 + bf_sc/util/makefile.pmk | 29 + bf_sc/util/sc_hidother.src | 487 ++ bf_sc/util/verinfo.rc | 153 + bf_sch/source/core/makefile.mk | 96 + bf_sch/source/core/sch_ReBuildHint.cxx | 37 + bf_sch/source/core/sch_SchAddInCollection.cxx | 129 + bf_sch/source/core/sch_axisid.cxx | 79 + bf_sch/source/core/sch_axisobj.cxx | 59 + bf_sch/source/core/sch_calculat.cxx | 206 + bf_sch/source/core/sch_chartbar.cxx | 177 + bf_sch/source/core/sch_chartdoc.cxx | 420 ++ bf_sch/source/core/sch_charttyp.cxx | 807 +++ bf_sch/source/core/sch_chaxis.cxx | 2498 ++++++++ bf_sch/source/core/sch_chdescr.cxx | 127 + bf_sch/source/core/sch_chtm3d2.cxx | 550 ++ bf_sch/source/core/sch_chtmod2a.cxx | 1324 ++++ bf_sch/source/core/sch_chtmod3d.cxx | 2041 +++++++ bf_sch/source/core/sch_chtmode1.cxx | 981 +++ bf_sch/source/core/sch_chtmode2.cxx | 2118 +++++++ bf_sch/source/core/sch_chtmode3.cxx | 1450 +++++ bf_sch/source/core/sch_chtmode4.cxx | 1621 +++++ bf_sch/source/core/sch_chtmode5.cxx | 373 ++ bf_sch/source/core/sch_chtmode6.cxx | 268 + bf_sch/source/core/sch_chtmode7.cxx | 563 ++ bf_sch/source/core/sch_chtmode8.cxx | 647 ++ bf_sch/source/core/sch_chtmode9.cxx | 1860 ++++++ bf_sch/source/core/sch_chtmodel.cxx | 1263 ++++ bf_sch/source/core/sch_chtscene.cxx | 265 + bf_sch/source/core/sch_datapoin.cxx | 135 + bf_sch/source/core/sch_datarow.cxx | 130 + bf_sch/source/core/sch_glob.src | 507 ++ bf_sch/source/core/sch_globfunc.cxx | 1264 ++++ bf_sch/source/core/sch_itempool.cxx | 486 ++ bf_sch/source/core/sch_memchrt.cxx | 1352 +++++ bf_sch/source/core/sch_objadj.cxx | 113 + bf_sch/source/core/sch_objfac.cxx | 114 + bf_sch/source/core/sch_objid.cxx | 130 + bf_sch/source/core/sch_schgroup.cxx | 235 + bf_sch/source/core/sch_schiocmp.cxx | 61 + bf_sch/source/core/sch_stlpool.cxx | 86 + bf_sch/source/core/sch_stlsheet.cxx | 153 + bf_sch/source/filter/xml/makefile.mk | 44 + .../source/filter/xml/sch_SchXMLWrapper.cxx | 74 + bf_sch/source/makefile.mk | 63 + bf_sch/source/ui/app/makefile.mk | 87 + bf_sch/source/ui/app/sch_app.src | 66 + bf_sch/source/ui/app/sch_globopt.cxx | 111 + bf_sch/source/ui/app/sch_menuids.src | 180 + bf_sch/source/ui/app/sch_schdll.cxx | 170 + bf_sch/source/ui/app/sch_schlib.cxx | 261 + bf_sch/source/ui/app/sch_schmod.cxx | 142 + bf_sch/source/ui/app/sch_schopt.cxx | 177 + bf_sch/source/ui/app/sch_schresid.cxx | 55 + bf_sch/source/ui/app/sch_strings.src | 1058 ++++ bf_sch/source/ui/app/sch_typemap.cxx | 117 + bf_sch/source/ui/docshell/makefile.mk | 58 + bf_sch/source/ui/docshell/sch_docshel1.cxx | 192 + bf_sch/source/ui/docshell/sch_docshell.cxx | 680 +++ bf_sch/source/ui/inc/ChXChartData.hxx | 167 + .../inc/ChXChartDataChangeEventListener.hxx | 72 + bf_sch/source/ui/inc/ChXChartDrawPage.hxx | 105 + bf_sch/source/ui/inc/ChXChartObject.hxx | 230 + bf_sch/source/ui/inc/ChXDataPoint.hxx | 144 + bf_sch/source/ui/inc/ChXDataRow.hxx | 138 + bf_sch/source/ui/inc/ChXDiagram.hxx | 355 ++ bf_sch/source/ui/inc/ChartArea.hxx | 65 + bf_sch/source/ui/inc/ChartGrid.hxx | 65 + bf_sch/source/ui/inc/ChartLegend.hxx | 65 + bf_sch/source/ui/inc/ChartLine.hxx | 65 + bf_sch/source/ui/inc/ChartTitle.hxx | 70 + bf_sch/source/ui/inc/SchTransferable.hxx | 72 + bf_sch/source/ui/inc/dlgctrls.hxx | 57 + bf_sch/source/ui/inc/globopt.hxx | 58 + bf_sch/source/ui/inc/guiutil.hxx | 45 + bf_sch/source/ui/inc/res_bmp.hrc | 54 + bf_sch/source/ui/inc/res_hc_bmp.hrc | 126 + bf_sch/source/ui/inc/schhids.h | 93 + bf_sch/source/ui/inc/sdvcbrw.hxx | 71 + bf_sch/source/ui/inc/tbx_ww.hxx | 61 + .../source/ui/unoidl/descr/ChXChartAxis.xml | 19 + .../source/ui/unoidl/descr/ChXChartData.xml | 16 + .../ui/unoidl/descr/ChXChartDataArray.xml | 17 + .../ui/unoidl/descr/ChXChartDocument.xml | 19 + .../source/ui/unoidl/descr/ChXChartView.xml | 18 + .../source/ui/unoidl/descr/ChXDataPoint.xml | 21 + bf_sch/source/ui/unoidl/descr/ChXDataRow.xml | 23 + bf_sch/source/ui/unoidl/descr/ChXDiagram.xml | 32 + bf_sch/source/ui/unoidl/descr/ChartArea.xml | 20 + bf_sch/source/ui/unoidl/descr/ChartGrid.xml | 19 + bf_sch/source/ui/unoidl/descr/ChartLegend.xml | 20 + bf_sch/source/ui/unoidl/descr/ChartLine.xml | 19 + bf_sch/source/ui/unoidl/descr/ChartTitle.xml | 20 + bf_sch/source/ui/unoidl/makefile.mk | 87 + bf_sch/source/ui/unoidl/sch_ChXChartAxis.cxx | 901 +++ bf_sch/source/ui/unoidl/sch_ChXChartData.cxx | 479 ++ .../sch_ChXChartDataChangeEventListener.cxx | 106 + .../source/ui/unoidl/sch_ChXChartDocument.cxx | 1680 +++++ .../source/ui/unoidl/sch_ChXChartDrawPage.cxx | 252 + .../source/ui/unoidl/sch_ChXChartObject.cxx | 1392 +++++ bf_sch/source/ui/unoidl/sch_ChXDataPoint.cxx | 876 +++ bf_sch/source/ui/unoidl/sch_ChXDataRow.cxx | 811 +++ bf_sch/source/ui/unoidl/sch_ChXDiagram.cxx | 2062 +++++++ bf_sch/source/ui/unoidl/sch_ChartArea.cxx | 121 + bf_sch/source/ui/unoidl/sch_ChartGrid.cxx | 120 + bf_sch/source/ui/unoidl/sch_ChartLegend.cxx | 122 + bf_sch/source/ui/unoidl/sch_ChartLine.cxx | 119 + bf_sch/source/ui/unoidl/sch_ChartTitle.cxx | 184 + bf_sch/source/ui/unoidl/sch_mapprov.cxx | 415 ++ bf_sch/source/ui/unoidl/sch_register.cxx | 81 + bf_sch/source/ui/unoidl/sch_unodoc.cxx | 83 + bf_sch/util/bf_sch.component | 36 + bf_sch/util/bf_sch.map | 13 + bf_sch/util/makefile.mk | 111 + bf_sch/util/sch_hidother.src | 66 + bf_sch/util/sch_sch.cxx | 38 + bf_sch/util/verinfo.rc | 153 + bf_sd/source/core/makefile.mk | 70 + bf_sd/source/core/sd_anminfo.cxx | 316 + bf_sd/source/core/sd_cusshow.cxx | 174 + bf_sd/source/core/sd_drawdoc.cxx | 1339 ++++ bf_sd/source/core/sd_drawdoc2.cxx | 596 ++ bf_sd/source/core/sd_drawdoc3.cxx | 310 + bf_sd/source/core/sd_drawdoc4.cxx | 790 +++ bf_sd/source/core/sd_glob.src | 490 ++ bf_sd/source/core/sd_sdattr.cxx | 77 + bf_sd/source/core/sd_sdiocmpt.cxx | 72 + bf_sd/source/core/sd_sdobjfac.cxx | 91 + bf_sd/source/core/sd_sdpage.cxx | 2124 +++++++ bf_sd/source/core/sd_sdpage2.cxx | 347 ++ bf_sd/source/core/sd_stlpool.cxx | 1257 ++++ bf_sd/source/core/sd_stlsheet.cxx | 387 ++ bf_sd/source/filter/bin/makefile.mk | 49 + bf_sd/source/filter/bin/sd_sdbinfilter.cxx | 461 ++ bf_sd/source/filter/makefile.mk | 52 + bf_sd/source/filter/propread.hxx | 132 + bf_sd/source/filter/sd_propread.cxx | 86 + bf_sd/source/filter/sd_sdfilter.cxx | 131 + bf_sd/source/filter/xml/makefile.mk | 52 + bf_sd/source/filter/xml/sd_sdxmlwrp.cxx | 389 ++ bf_sd/source/ui/app/makefile.mk | 86 + bf_sd/source/ui/app/sd_optsitem.cxx | 865 +++ bf_sd/source/ui/app/sd_sddll.cxx | 63 + bf_sd/source/ui/app/sd_sdlib.cxx | 371 ++ bf_sd/source/ui/app/sd_sdmod.cxx | 142 + bf_sd/source/ui/app/sd_sdresid.cxx | 41 + bf_sd/source/ui/app/sd_strings.src | 74 + bf_sd/source/ui/docshell/makefile.mk | 52 + bf_sd/source/ui/docshell/sd_docshell.cxx | 460 ++ bf_sd/source/ui/docshell/sd_grdocsh.cxx | 65 + bf_sd/source/ui/inc/cfgids.hxx | 39 + bf_sd/source/ui/inc/optsitem.hxx | 581 ++ bf_sd/source/ui/inc/prlayout.hxx | 60 + bf_sd/source/ui/inc/strings.hrc | 39 + bf_sd/source/ui/inc/unokywds.hxx | 218 + bf_sd/source/ui/inc/unomodel.hxx | 328 + bf_sd/source/ui/inc/unoprnms.hxx | 104 + .../source/ui/unoidl/UnoDocumentSettings.hxx | 45 + bf_sd/source/ui/unoidl/makefile.mk | 73 + .../ui/unoidl/sd_UnoDocumentSettings.cxx | 1080 ++++ bf_sd/source/ui/unoidl/sd_facreg.cxx | 100 + bf_sd/source/ui/unoidl/sd_unocpres.cxx | 469 ++ bf_sd/source/ui/unoidl/sd_unodoc.cxx | 123 + bf_sd/source/ui/unoidl/sd_unogsfm.cxx | 491 ++ bf_sd/source/ui/unoidl/sd_unogstyl.cxx | 276 + bf_sd/source/ui/unoidl/sd_unokywds.cxx | 39 + bf_sd/source/ui/unoidl/sd_unolayer.cxx | 658 ++ bf_sd/source/ui/unoidl/sd_unomodel.cxx | 1945 ++++++ bf_sd/source/ui/unoidl/sd_unoobj.cxx | 1736 ++++++ bf_sd/source/ui/unoidl/sd_unopage.cxx | 2234 +++++++ bf_sd/source/ui/unoidl/sd_unopback.cxx | 427 ++ bf_sd/source/ui/unoidl/sd_unopool.cxx | 105 + bf_sd/source/ui/unoidl/sd_unopres.cxx | 428 ++ bf_sd/source/ui/unoidl/sd_unopsfm.cxx | 375 ++ bf_sd/source/ui/unoidl/sd_unopstyl.cxx | 637 ++ bf_sd/source/ui/unoidl/sd_unostyls.cxx | 303 + bf_sd/source/ui/unoidl/sd_unowcntr.cxx | 107 + bf_sd/source/ui/unoidl/unocpres.hxx | 173 + bf_sd/source/ui/unoidl/unogsfm.hxx | 108 + bf_sd/source/ui/unoidl/unogstyl.hxx | 74 + bf_sd/source/ui/unoidl/unohelp.hxx | 64 + bf_sd/source/ui/unoidl/unolayer.hxx | 153 + bf_sd/source/ui/unoidl/unoobj.hxx | 121 + bf_sd/source/ui/unoidl/unopage.hxx | 301 + bf_sd/source/ui/unoidl/unopback.hxx | 98 + bf_sd/source/ui/unoidl/unopres.hxx | 79 + bf_sd/source/ui/unoidl/unopsfm.hxx | 104 + bf_sd/source/ui/unoidl/unopstyl.hxx | 123 + bf_sd/source/ui/unoidl/unostyls.hxx | 88 + bf_sd/source/ui/unoidl/unowcntr.hxx | 62 + bf_sd/source/ui/view/makefile.mk | 54 + bf_sd/source/ui/view/sd_frmview.cxx | 921 +++ bf_sd/source/ui/view/sd_sdoutl.cxx | 70 + bf_sd/util/bf_sd.component | 37 + bf_sd/util/bf_sd.map | 12 + bf_sd/util/exports.dxp | 1 + bf_sd/util/hidother.hrc | 42 + bf_sd/util/makefile.mk | 173 + bf_sd/util/makefile.pmk | 27 + bf_sd/util/sd_hidother.src | 130 + bf_sd/util/sd_sd.cxx | 38 + bf_sd/util/split_rc.awk | 57 + bf_sd/util/verinfo.rc | 153 + bf_sfx2/source/appl/appimp.hxx | 85 + bf_sfx2/source/appl/imestatuswindow.hxx | 114 + bf_sfx2/source/appl/makefile.mk | 85 + bf_sfx2/source/appl/sfx2_app.cxx | 188 + bf_sfx2/source/appl/sfx2_app.src | 2372 ++++++++ bf_sfx2/source/appl/sfx2_appbas.cxx | 193 + bf_sfx2/source/appl/sfx2_appcfg.cxx | 143 + bf_sfx2/source/appl/sfx2_appdata.cxx | 68 + bf_sfx2/source/appl/sfx2_appinit.cxx | 208 + bf_sfx2/source/appl/sfx2_appmain.cxx | 196 + bf_sfx2/source/appl/sfx2_appmisc.cxx | 106 + bf_sfx2/source/appl/sfx2_appopen.cxx | 179 + bf_sfx2/source/appl/sfx2_appquit.cxx | 109 + bf_sfx2/source/appl/sfx2_appuno.cxx | 980 +++ bf_sfx2/source/appl/sfx2_dlgcont.cxx | 245 + bf_sfx2/source/appl/sfx2_imestatuswindow.cxx | 175 + bf_sfx2/source/appl/sfx2_minbox.src | 256 + bf_sfx2/source/appl/sfx2_module.cxx | 122 + bf_sfx2/source/appl/sfx2_namecont.cxx | 1764 ++++++ bf_sfx2/source/appl/sfx2_scriptcont.cxx | 437 ++ bf_sfx2/source/appl/sfx2_sfx.src | 257 + bf_sfx2/source/appl/sfx2_sfxdll.cxx | 70 + bf_sfx2/source/bastyp/etcp.h | 519 ++ bf_sfx2/source/bastyp/fltlst.hxx | 79 + bf_sfx2/source/bastyp/l2s.hxx | 48 + bf_sfx2/source/bastyp/makefile.mk | 56 + bf_sfx2/source/bastyp/sfx2_bitset.cxx | 273 + bf_sfx2/source/bastyp/sfx2_fltfnc.cxx | 1295 ++++ bf_sfx2/source/bastyp/sfx2_fltlst.cxx | 141 + bf_sfx2/source/bastyp/sfx2_minarray.cxx | 186 + bf_sfx2/source/bastyp/sfx2_misc.cxx | 44 + bf_sfx2/source/bastyp/sfx2_progress.cxx | 398 ++ bf_sfx2/source/config/cfgimpl.hxx | 88 + bf_sfx2/source/config/makefile.mk | 54 + bf_sfx2/source/config/sfx2_cfgitem.cxx | 103 + bf_sfx2/source/config/sfx2_cfgmgr.cxx | 483 ++ bf_sfx2/source/config/sfx2_evntconf.cxx | 603 ++ bf_sfx2/source/config/sfx2_misccfg.cxx | 123 + bf_sfx2/source/control/makefile.mk | 61 + bf_sfx2/source/control/sfx2_macrconf.cxx | 162 + bf_sfx2/source/control/sfx2_request.cxx | 71 + bf_sfx2/source/control/sfx2_shell.cxx | 133 + bf_sfx2/source/control/sfx2_srchitem.cxx | 287 + bf_sfx2/source/doc/makefile.mk | 78 + bf_sfx2/source/doc/sfx2_dinfobj.cxx | 232 + bf_sfx2/source/doc/sfx2_docfac.cxx | 325 + bf_sfx2/source/doc/sfx2_docfile.cxx | 1805 ++++++ bf_sfx2/source/doc/sfx2_docfilt.cxx | 141 + bf_sfx2/source/doc/sfx2_docinf.cxx | 950 +++ bf_sfx2/source/doc/sfx2_frameobj.cxx | 121 + bf_sfx2/source/doc/sfx2_frmdescr.cxx | 165 + bf_sfx2/source/doc/sfx2_interno.cxx | 244 + bf_sfx2/source/doc/sfx2_objcont.cxx | 303 + bf_sfx2/source/doc/sfx2_objitem.cxx | 88 + bf_sfx2/source/doc/sfx2_objmisc.cxx | 927 +++ bf_sfx2/source/doc/sfx2_objserv.cxx | 169 + bf_sfx2/source/doc/sfx2_objstor.cxx | 1286 ++++ bf_sfx2/source/doc/sfx2_objuno.cxx | 906 +++ bf_sfx2/source/doc/sfx2_objxtor.cxx | 588 ++ bf_sfx2/source/doc/sfx2_plugobj.cxx | 355 ++ bf_sfx2/source/doc/sfx2_sfxbasemodel.cxx | 1364 +++++ bf_sfx2/source/doc/sfx2_xmlversion.cxx | 351 ++ bf_sfx2/source/doc/timestamp.cxx | 402 ++ bf_sfx2/source/doc/xmlversion.hxx | 127 + bf_sfx2/source/explorer/makefile.mk | 51 + bf_sfx2/source/explorer/sfx2_nochaos.cxx | 217 + bf_sfx2/source/inc/appbas.hxx | 48 + bf_sfx2/source/inc/appdata.hxx | 119 + bf_sfx2/source/inc/cfgmgr.hxx | 93 + bf_sfx2/source/inc/conttrans.hxx | 113 + bf_sfx2/source/inc/dinfobj.hxx | 62 + bf_sfx2/source/inc/dlgcont.hxx | 122 + bf_sfx2/source/inc/doctemplates.hxx | 115 + bf_sfx2/source/inc/eventsupplier.hxx | 151 + bf_sfx2/source/inc/fltfnc.hxx | 39 + bf_sfx2/source/inc/fltoptint.hxx | 78 + bf_sfx2/source/inc/helper.hxx | 62 + bf_sfx2/source/inc/namecont.hxx | 495 ++ bf_sfx2/source/inc/nochaos.hxx | 44 + bf_sfx2/source/inc/objshimp.hxx | 203 + bf_sfx2/source/inc/openflag.hxx | 46 + bf_sfx2/source/inc/referers.hxx | 41 + bf_sfx2/source/inc/scriptcont.hxx | 164 + bf_sfx2/source/inc/sfxtypes.hxx | 168 + bf_sfx2/source/inc/tplcomp.hxx | 219 + bf_sfx2/source/notify/makefile.mk | 53 + bf_sfx2/source/notify/sfx2_eventsupplier.cxx | 453 ++ bf_sfx2/source/notify/sfx2_hintpost.cxx | 48 + bf_sfx2/source/view/makefile.mk | 51 + bf_sfx2/source/view/sfx2_printer.cxx | 160 + bf_sfx2/util/make_tco.btm | 1 + bf_sfx2/util/makefile.mk | 69 + bf_sfx2/util/makefile.prj | 1 + bf_sfx2/util/sfx.xml | 96 + bf_so3/inc/binddata.hxx | 87 + bf_so3/inc/insdlg.hxx | 81 + bf_so3/inc/soimpl.hxx | 53 + bf_so3/inc/svuidlg.hrc | 36 + bf_so3/source/copied/makefile.mk | 38 + bf_so3/source/copied/staticbaseurl.cxx | 156 + bf_so3/source/data/makefile.mk | 47 + bf_so3/source/data/pseudo.cxx | 363 ++ bf_so3/source/dialog/insdlg.cxx | 200 + bf_so3/source/dialog/ipwin.cxx | 805 +++ bf_so3/source/dialog/makefile.mk | 55 + bf_so3/source/dialog/plfilter.cxx | 60 + bf_so3/source/inplace/applet2.cxx | 851 +++ bf_so3/source/inplace/client.cxx | 547 ++ bf_so3/source/inplace/embobj.cxx | 944 +++ bf_so3/source/inplace/ipclient.cxx | 342 ++ bf_so3/source/inplace/ipenv.cxx | 1006 +++ bf_so3/source/inplace/ipobj.cxx | 433 ++ bf_so3/source/inplace/makefile.mk | 63 + bf_so3/source/inplace/outplace.cxx | 1454 +++++ bf_so3/source/inplace/plugin.cxx | 923 +++ bf_so3/source/inplace/protocol.cxx | 1234 ++++ bf_so3/source/inplace/rmapplet.cxx | 413 ++ bf_so3/source/inplace/soconv.cxx | 415 ++ bf_so3/source/inplace/viscache.hxx | 88 + bf_so3/source/misc/factory.cxx | 721 +++ bf_so3/source/misc/iface.cxx | 173 + bf_so3/source/misc/makefile.mk | 64 + bf_so3/source/misc/so2dll.cxx | 107 + bf_so3/source/ole/ansi.cxx | 414 ++ bf_so3/source/ole/helpers.cxx | 926 +++ bf_so3/source/ole/makefile.mk | 64 + bf_so3/source/ole/socli.cxx | 263 + bf_so3/source/ole/socont.cxx | 2054 +++++++ bf_so3/source/ole/socont.h | 301 + bf_so3/source/ole/soole.h | 464 ++ bf_so3/source/ole/sosink.cxx | 241 + bf_so3/source/ole/uieffect.cxx | 276 + bf_so3/source/persist/binddata.cxx | 558 ++ bf_so3/source/persist/makefile.mk | 65 + bf_so3/source/persist/persist.cxx | 1313 ++++ bf_so3/source/persist/svstor.cxx | 444 ++ bf_so3/source/persist/transbnd.cxx | 426 ++ bf_so3/source/persist/transprt.cxx | 2153 +++++++ bf_so3/source/persist/transuno.cxx | 173 + bf_so3/source/persist/transuno.hxx | 96 + bf_so3/source/solink/impldde.cxx | 383 ++ bf_so3/source/solink/impldde.hxx | 80 + bf_so3/source/solink/linkmgr2.cxx | 324 + bf_so3/source/solink/linksrc.cxx | 392 ++ bf_so3/source/solink/lnkbase2.cxx | 371 ++ bf_so3/source/solink/makefile.mk | 59 + bf_so3/src/makefile.mk | 48 + bf_so3/src/nocode.src | 221 + bf_so3/util/makefile.mk | 147 + bf_so3/util/makefile.pmk | 30 + bf_starmath/source/cfgitem.hxx | 247 + bf_starmath/source/makefile.mk | 100 + bf_starmath/source/mathml.hxx | 398 ++ bf_starmath/source/starmath_cfgitem.cxx | 823 +++ bf_starmath/source/starmath_command.cxx | 81 + bf_starmath/source/starmath_commands.src | 93 + bf_starmath/source/starmath_config.cxx | 80 + bf_starmath/source/starmath_document.cxx | 768 +++ bf_starmath/source/starmath_format.cxx | 402 ++ bf_starmath/source/starmath_mathml.cxx | 3703 +++++++++++ bf_starmath/source/starmath_node.cxx | 2387 ++++++++ bf_starmath/source/starmath_parse.cxx | 2343 +++++++ bf_starmath/source/starmath_rect.cxx | 642 ++ bf_starmath/source/starmath_register.cxx | 200 + bf_starmath/source/starmath_smdll.cxx | 90 + bf_starmath/source/starmath_smlib.cxx | 320 + bf_starmath/source/starmath_smmod.cxx | 263 + bf_starmath/source/starmath_smres.src | 713 +++ bf_starmath/source/starmath_symbol.cxx | 376 ++ bf_starmath/source/starmath_symbol.src | 2246 +++++++ bf_starmath/source/starmath_typemap.cxx | 154 + bf_starmath/source/starmath_unodoc.cxx | 82 + bf_starmath/source/starmath_unomodel.cxx | 882 +++ bf_starmath/source/starmath_utility.cxx | 323 + bf_starmath/util/bf_sm.component | 55 + bf_starmath/util/bf_sm.map | 10 + bf_starmath/util/makefile.mk | 96 + bf_starmath/util/makefile.pmk | 29 + bf_starmath/util/starmath_hidother.src | 118 + bf_svtools/source/config/itemholder1.hxx | 99 + bf_svtools/source/config/itemholder2.hxx | 98 + bf_svtools/source/config/itemholderbase.hxx | 138 + bf_svtools/source/config/makefile.mk | 85 + .../config/svt_addxmltostorageoptions.cxx | 278 + bf_svtools/source/config/svt_cacheoptions.cxx | 345 ++ bf_svtools/source/config/svt_cjkoptions.cxx | 399 ++ bf_svtools/source/config/svt_cmdoptions.cxx | 435 ++ bf_svtools/source/config/svt_colorcfg.cxx | 473 ++ .../source/config/svt_compatibility.cxx | 613 ++ bf_svtools/source/config/svt_ctloptions.cxx | 365 ++ .../source/config/svt_defaultoptions.cxx | 322 + .../source/config/svt_dynamicmenuoptions.cxx | 700 +++ .../config/svt_extendedsecurityoptions.cxx | 411 ++ bf_svtools/source/config/svt_fontoptions.cxx | 381 ++ bf_svtools/source/config/svt_helpopt.cxx | 577 ++ .../source/config/svt_historyoptions.cxx | 606 ++ bf_svtools/source/config/svt_inetoptions.cxx | 312 + .../source/config/svt_internaloptions.cxx | 369 ++ bf_svtools/source/config/svt_itemholder1.cxx | 321 + bf_svtools/source/config/svt_itemholder2.cxx | 237 + .../source/config/svt_languageoptions.cxx | 113 + bf_svtools/source/config/svt_lingucfg.cxx | 545 ++ .../source/config/svt_localisationoptions.cxx | 365 ++ bf_svtools/source/config/svt_menuoptions.cxx | 434 ++ bf_svtools/source/config/svt_misccfg.cxx | 149 + bf_svtools/source/config/svt_miscopt.cxx | 637 ++ .../source/config/svt_moduleoptions.cxx | 963 +++ bf_svtools/source/config/svt_options.cxx | 42 + bf_svtools/source/config/svt_options3d.cxx | 306 + bf_svtools/source/config/svt_optionsdlg.cxx | 225 + bf_svtools/source/config/svt_pathoptions.cxx | 900 +++ bf_svtools/source/config/svt_printoptions.cxx | 498 ++ .../source/config/svt_printwarningoptions.cxx | 334 + bf_svtools/source/config/svt_saveopt.cxx | 629 ++ bf_svtools/source/config/svt_searchopt.cxx | 376 ++ .../source/config/svt_securityoptions.cxx | 838 +++ .../source/config/svt_sourceviewconfig.cxx | 222 + bf_svtools/source/config/svt_startoptions.cxx | 367 ++ .../source/config/svt_syslocaleoptions.cxx | 471 ++ bf_svtools/source/config/svt_undoopt.cxx | 210 + bf_svtools/source/config/svt_useroptions.cxx | 584 ++ bf_svtools/source/config/svt_viewoptions.cxx | 542 ++ .../source/config/svt_workingsetoptions.cxx | 340 ++ bf_svtools/source/filerec/makefile.mk | 46 + bf_svtools/source/filerec/svt_filerec.cxx | 435 ++ .../filter.vcl/filter/FilterConfigCache.hxx | 145 + .../source/filter.vcl/filter/makefile.mk | 68 + bf_svtools/source/filter.vcl/filter/sgf.ini | 118 + .../filter/svt_FilterConfigCache.cxx | 615 ++ .../filter/svt_FilterConfigItem.cxx | 384 ++ .../source/filter.vcl/filter/svt_filter.cxx | 2009 ++++++ .../source/filter.vcl/filter/svt_filter2.cxx | 1323 ++++ .../source/filter.vcl/filter/svt_fldll.cxx | 77 + .../source/filter.vcl/filter/svt_sgfbram.cxx | 609 ++ .../source/filter.vcl/filter/svt_sgvmain.cxx | 1089 ++++ .../source/filter.vcl/filter/svt_sgvspln.cxx | 883 +++ .../source/filter.vcl/filter/svt_sgvtext.cxx | 1289 ++++ bf_svtools/source/filter.vcl/igif/decode.hxx | 76 + bf_svtools/source/filter.vcl/igif/makefile.mk | 44 + .../source/filter.vcl/igif/svt_decode.cxx | 218 + .../source/filter.vcl/igif/svt_gifread.cxx | 860 +++ bf_svtools/source/filter.vcl/ixbm/makefile.mk | 43 + .../source/filter.vcl/ixbm/svt_xbmread.cxx | 403 ++ bf_svtools/source/filter.vcl/ixpm/makefile.mk | 42 + .../source/filter.vcl/ixpm/rgbtable.hxx | 704 +++ .../source/filter.vcl/ixpm/svt_xpmread.cxx | 695 +++ bf_svtools/source/filter.vcl/jpeg/jpeg.h | 78 + bf_svtools/source/filter.vcl/jpeg/makefile.mk | 43 + .../source/filter.vcl/jpeg/svt_jpeg.cxx | 750 +++ bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c | 280 + bf_svtools/source/filter.vcl/wmf/emfwr.hxx | 104 + bf_svtools/source/filter.vcl/wmf/makefile.mk | 50 + .../source/filter.vcl/wmf/svt_emfwr.cxx | 1288 ++++ .../source/filter.vcl/wmf/svt_enhwmf.cxx | 1298 ++++ .../source/filter.vcl/wmf/svt_winmtf.cxx | 2174 +++++++ .../source/filter.vcl/wmf/svt_winwmf.cxx | 1314 ++++ bf_svtools/source/filter.vcl/wmf/svt_wmf.cxx | 111 + .../source/filter.vcl/wmf/svt_wmfwr.cxx | 1878 ++++++ bf_svtools/source/filter.vcl/wmf/winmtf.hxx | 762 +++ bf_svtools/source/filter.vcl/wmf/wmfwr.hxx | 222 + bf_svtools/source/inc/fsfactory.hxx | 80 + bf_svtools/source/inc/poolio.hxx | 209 + bf_svtools/source/items/makefile.mk | 58 + bf_svtools/source/items/svt_aeitem.cxx | 247 + bf_svtools/source/items/svt_eitem.cxx | 53 + bf_svtools/source/items/svt_flagitem.cxx | 137 + .../source/items/svt_globalnameitem.cxx | 111 + bf_svtools/source/items/svt_intitem.cxx | 296 + bf_svtools/source/items/svt_macitem.cxx | 238 + bf_svtools/source/items/svt_poolcach.cxx | 142 + bf_svtools/source/items/svt_ptitem.cxx | 193 + bf_svtools/source/items/svt_rectitem.cxx | 189 + bf_svtools/source/items/svt_rngitem.cxx | 54 + bf_svtools/source/items/svt_rngitem_inc.cxx | 206 + bf_svtools/source/items/svt_stritem.cxx | 70 + bf_svtools/source/items/svt_style.cxx | 1073 ++++ bf_svtools/source/items/svt_szitem.cxx | 199 + bf_svtools/source/items1/makefile.mk | 71 + bf_svtools/source/items1/svt_bintitem.cxx | 157 + bf_svtools/source/items1/svt_cenumitm.cxx | 277 + bf_svtools/source/items1/svt_cintitem.cxx | 525 ++ bf_svtools/source/items1/svt_cntwall.cxx | 151 + bf_svtools/source/items1/svt_cstitem.cxx | 145 + bf_svtools/source/items1/svt_ctypeitm.cxx | 232 + bf_svtools/source/items1/svt_custritm.cxx | 145 + bf_svtools/source/items1/svt_dateitem.cxx | 220 + bf_svtools/source/items1/svt_dtritem.cxx | 220 + bf_svtools/source/items1/svt_frqitem.cxx | 186 + bf_svtools/source/items1/svt_ilstitem.cxx | 95 + bf_svtools/source/items1/svt_itemiter.cxx | 99 + bf_svtools/source/items1/svt_itempool.cxx | 1079 ++++ bf_svtools/source/items1/svt_itemprop.cxx | 463 ++ bf_svtools/source/items1/svt_itemset.cxx | 1929 ++++++ bf_svtools/source/items1/svt_lckbitem.cxx | 175 + bf_svtools/source/items1/svt_nranges.cxx | 622 ++ bf_svtools/source/items1/svt_poolio.cxx | 1249 ++++ bf_svtools/source/items1/svt_poolitem.cxx | 373 ++ bf_svtools/source/items1/svt_sfontitm.cxx | 123 + bf_svtools/source/items1/svt_sitem.cxx | 107 + bf_svtools/source/items1/svt_slstitm.cxx | 308 + bf_svtools/source/items1/svt_stylepool.cxx | 265 + bf_svtools/source/items1/svt_tfrmitem.cxx | 149 + bf_svtools/source/items1/svt_tresitem.cxx | 80 + bf_svtools/source/items1/svt_visitem.cxx | 141 + bf_svtools/source/items1/svt_whiter.cxx | 91 + bf_svtools/source/items1/whassert.hxx | 61 + bf_svtools/source/memtools/makefile.mk | 48 + bf_svtools/source/memtools/svt_svarray.cxx | 269 + bf_svtools/source/memtools/tl_contnr.cxx | 1425 +++++ bf_svtools/source/memtools/tl_unqidx.cxx | 452 ++ bf_svtools/source/misc/ctrltool.src | 144 + bf_svtools/source/misc/errtxt.src | 506 ++ bf_svtools/source/misc/makefile.mk | 66 + bf_svtools/source/misc/svt_asynclink.cxx | 135 + bf_svtools/source/misc/svt_ctrltool.cxx | 408 ++ bf_svtools/source/misc/svt_ehdl.cxx | 468 ++ bf_svtools/source/misc/svt_flbytes.cxx | 109 + .../source/misc/svt_imageresourceaccess.cxx | 196 + bf_svtools/source/misc/svt_imap.cxx | 1015 ++++ bf_svtools/source/misc/svt_imap2.cxx | 56 + bf_svtools/source/misc/svt_imap3.cxx | 100 + bf_svtools/source/misc/svt_ownlist.cxx | 128 + .../source/misc/svt_restrictedpaths.cxx | 113 + .../source/misc/svt_templatefoldercache.cxx | 138 + bf_svtools/source/misc/svt_urihelper.cxx | 664 ++ bf_svtools/source/misc/svt_vcldata.cxx | 51 + bf_svtools/source/misc/tl_tstring.cxx | 126 + bf_svtools/source/misc1/makefile.mk | 60 + .../source/misc1/svt_PasswordHelper.cxx | 108 + bf_svtools/source/misc1/svt_adrparse.cxx | 783 +++ .../source/misc1/svt_docpasswdrequest.cxx | 138 + bf_svtools/source/misc1/svt_fstathelper.cxx | 91 + bf_svtools/source/misc1/svt_inethist.cxx | 515 ++ bf_svtools/source/misc1/svt_inettype.cxx | 862 +++ bf_svtools/source/misc1/svt_loginerr.cxx | 44 + bf_svtools/source/misc1/svt_strmadpt.cxx | 887 +++ bf_svtools/source/misc1/svt_svtdata.cxx | 61 + bf_svtools/source/notify/listenerbase.hxx | 63 + bf_svtools/source/notify/makefile.mk | 55 + bf_svtools/source/notify/svt_brdcst.cxx | 192 + bf_svtools/source/notify/svt_broadcast.cxx | 121 + bf_svtools/source/notify/svt_cancel.cxx | 207 + bf_svtools/source/notify/svt_hint.cxx | 49 + bf_svtools/source/notify/svt_isethint.cxx | 49 + bf_svtools/source/notify/svt_listener.cxx | 167 + bf_svtools/source/notify/svt_listenerbase.cxx | 81 + bf_svtools/source/notify/svt_listeneriter.cxx | 116 + bf_svtools/source/notify/svt_lstner.cxx | 180 + bf_svtools/source/notify/svt_smplhint.cxx | 49 + bf_svtools/source/numbers/makefile.mk | 71 + bf_svtools/source/numbers/numfmuno.hxx | 322 + bf_svtools/source/numbers/numhead.hxx | 98 + bf_svtools/source/numbers/supservs.hxx | 109 + bf_svtools/source/numbers/svt_nbdll.cxx | 80 + bf_svtools/source/numbers/svt_numfmuno.cxx | 1143 ++++ bf_svtools/source/numbers/svt_numhead.cxx | 200 + bf_svtools/source/numbers/svt_numuno.cxx | 164 + bf_svtools/source/numbers/svt_supservs.cxx | 234 + bf_svtools/source/numbers/svt_zforfind.cxx | 2764 +++++++++ bf_svtools/source/numbers/svt_zforlist.cxx | 3926 ++++++++++++ bf_svtools/source/numbers/svt_zformat.cxx | 3867 ++++++++++++ bf_svtools/source/numbers/svt_zforscan.cxx | 2768 +++++++++ bf_svtools/source/numbers/zforscan.hxx | 278 + bf_svtools/source/svdde/ddeimp.hxx | 188 + bf_svtools/source/svdde/ddemldeb.hxx | 73 + bf_svtools/source/svdde/ddemlimp.hxx | 440 ++ bf_svtools/source/svdde/ddemlos2.h | 381 ++ bf_svtools/source/svdde/ddewrap.hxx | 32 + bf_svtools/source/svdde/makefile.mk | 59 + bf_svtools/source/svdde/svt_ddecli.cxx | 476 ++ bf_svtools/source/svdde/svt_ddedata.cxx | 233 + bf_svtools/source/svdde/svt_ddedll.cxx | 68 + bf_svtools/source/svdde/svt_ddedummy.cxx | 144 + bf_svtools/source/svdde/svt_ddeinf.cxx | 58 + bf_svtools/source/svdde/svt_ddeml1.cxx | 2445 ++++++++ bf_svtools/source/svdde/svt_ddeml2.cxx | 956 +++ bf_svtools/source/svdde/svt_ddemldeb.cxx | 251 + bf_svtools/source/svdde/svt_ddestrg.cxx | 82 + bf_svtools/source/svdde/svt_ddesvr.cxx | 1049 ++++ bf_svtools/source/svdde/svt_ddewrap.cxx | 105 + bf_svtools/source/syslocale/makefile.mk | 44 + bf_svtools/source/syslocale/svt_syslocale.cxx | 168 + bf_svtools/source/undo/makefile.mk | 46 + bf_svtools/source/undo/svt_undo.cxx | 611 ++ bf_svtools/source/uno/makefile.mk | 48 + .../source/uno/svt_registerservices.cxx | 107 + bf_svtools/source/uno/svt_unoevent.cxx | 595 ++ bf_svtools/source/uno/svt_unoimap.cxx | 826 +++ bf_svtools/util/bf_svt.component | 39 + bf_svtools/util/makefile.mk | 136 + bf_svtools/util/svt.flt | 84 + bf_svx/source/dialog/impgrf.hrc | 38 + bf_svx/source/dialog/makefile.mk | 74 + bf_svx/source/dialog/svx_dlgutil.cxx | 111 + bf_svx/source/dialog/svx_impgrf.cxx | 88 + bf_svx/source/dialog/svx_impgrf.src | 121 + bf_svx/source/dialog/svx_lingu.src | 229 + bf_svx/source/dialog/svx_rulritem.cxx | 223 + bf_svx/source/dialog/svx_sdstring.src | 3956 ++++++++++++ bf_svx/source/editeng/editattr.hxx | 420 ++ bf_svx/source/editeng/editdoc.hxx | 715 +++ bf_svx/source/editeng/editeng.hrc | 58 + bf_svx/source/editeng/editobj2.hxx | 269 + bf_svx/source/editeng/editsel.hxx | 84 + bf_svx/source/editeng/editstt2.hxx | 134 + bf_svx/source/editeng/editundo.hxx | 118 + bf_svx/source/editeng/eerdll2.hxx | 67 + bf_svx/source/editeng/impedit.hxx | 748 +++ bf_svx/source/editeng/makefile.mk | 79 + bf_svx/source/editeng/svx_editattr.cxx | 454 ++ bf_svx/source/editeng/svx_editdbg.cxx | 75 + bf_svx/source/editeng/svx_editdoc.cxx | 1970 ++++++ bf_svx/source/editeng/svx_editdoc2.cxx | 273 + bf_svx/source/editeng/svx_editeng.cxx | 1202 ++++ bf_svx/source/editeng/svx_editeng.src | 321 + bf_svx/source/editeng/svx_editobj.cxx | 1011 +++ bf_svx/source/editeng/svx_editsel.cxx | 73 + bf_svx/source/editeng/svx_editundo.cxx | 157 + bf_svx/source/editeng/svx_editview.cxx | 148 + bf_svx/source/editeng/svx_eerdll.cxx | 239 + .../editeng/svx_forbiddencharacterstable.cxx | 85 + bf_svx/source/editeng/svx_impedit.cxx | 219 + bf_svx/source/editeng/svx_impedit2.cxx | 1949 ++++++ bf_svx/source/editeng/svx_impedit3.cxx | 2814 +++++++++ bf_svx/source/editeng/svx_impedit4.cxx | 473 ++ bf_svx/source/editeng/svx_impedit5.cxx | 510 ++ bf_svx/source/editeng/svx_swafopt.cxx | 104 + bf_svx/source/editeng/svx_txtrange.cxx | 620 ++ bf_svx/source/editeng/svx_unolingu.cxx | 407 ++ bf_svx/source/engine3d/makefile.mk | 75 + bf_svx/source/engine3d/svx_camera3d.cxx | 333 + bf_svx/source/engine3d/svx_class3d.cxx | 103 + bf_svx/source/engine3d/svx_cube3d.cxx | 276 + bf_svx/source/engine3d/svx_deflt3d.cxx | 93 + bf_svx/source/engine3d/svx_dlight3d.cxx | 137 + bf_svx/source/engine3d/svx_e3dcmpt.cxx | 61 + bf_svx/source/engine3d/svx_extrud3d.cxx | 565 ++ bf_svx/source/engine3d/svx_float3d.cxx | 62 + bf_svx/source/engine3d/svx_float3d.src | 110 + bf_svx/source/engine3d/svx_label3d.cxx | 126 + bf_svx/source/engine3d/svx_lathe3d.cxx | 711 +++ bf_svx/source/engine3d/svx_light3d.cxx | 242 + bf_svx/source/engine3d/svx_obj3d.cxx | 2437 ++++++++ bf_svx/source/engine3d/svx_objfac3d.cxx | 132 + bf_svx/source/engine3d/svx_plight3d.cxx | 120 + bf_svx/source/engine3d/svx_pntobj3d.cxx | 151 + bf_svx/source/engine3d/svx_poly3d.cxx | 1953 ++++++ bf_svx/source/engine3d/svx_polygn3d.cxx | 352 ++ bf_svx/source/engine3d/svx_polyob3d.cxx | 568 ++ bf_svx/source/engine3d/svx_polysc3d.cxx | 76 + bf_svx/source/engine3d/svx_scene3d.cxx | 1289 ++++ bf_svx/source/engine3d/svx_sphere3d.cxx | 518 ++ bf_svx/source/engine3d/svx_svx3ditems.cxx | 526 ++ bf_svx/source/engine3d/svx_view3d.cxx | 170 + bf_svx/source/engine3d/svx_viewpt3d.cxx | 490 ++ bf_svx/source/engine3d/svx_volume3d.cxx | 152 + bf_svx/source/form/makefile.mk | 71 + bf_svx/source/form/svx_fmdmod.cxx | 63 + bf_svx/source/form/svx_fmdpage.cxx | 129 + bf_svx/source/form/svx_fmimplids.cxx | 37 + bf_svx/source/form/svx_fmmodel.cxx | 288 + bf_svx/source/form/svx_fmobj.cxx | 194 + bf_svx/source/form/svx_fmobjfac.cxx | 105 + bf_svx/source/form/svx_fmpage.cxx | 145 + bf_svx/source/form/svx_fmpgeimp.cxx | 214 + bf_svx/source/form/svx_fmprop.cxx | 53 + bf_svx/source/form/svx_fmsearch.src | 120 + bf_svx/source/form/svx_fmstring.src | 352 ++ bf_svx/source/form/svx_fmtools.cxx | 73 + bf_svx/source/form/svx_siimport.cxx | 161 + bf_svx/source/form/svx_tbxform.src | 111 + bf_svx/source/inc/XPropertyTable.hxx | 48 + bf_svx/source/inc/fmexch.hxx | 123 + bf_svx/source/inc/fmimplids.hxx | 41 + bf_svx/source/inc/fmobj.hxx | 103 + bf_svx/source/inc/fmpgeimp.hxx | 124 + bf_svx/source/inc/fmprop.hrc | 372 ++ bf_svx/source/inc/fmresids.hrc | 147 + bf_svx/source/inc/fmsearch.hrc | 69 + bf_svx/source/inc/fmservs.hxx | 104 + bf_svx/source/inc/fmshimp.hxx | 178 + bf_svx/source/inc/fmstatic.hxx | 82 + bf_svx/source/inc/fmtools.hxx | 91 + bf_svx/source/inc/mutxhelp.hxx | 48 + bf_svx/source/inc/svdoimp.hxx | 268 + bf_svx/source/inc/svdoutlinercache.hxx | 58 + bf_svx/source/inc/unoedprx.hxx | 155 + bf_svx/source/inc/unopolyhelper.hxx | 55 + bf_svx/source/inc/xmlxtexp.hxx | 48 + bf_svx/source/inc/xmlxtimp.hxx | 67 + bf_svx/source/items/makefile.mk | 79 + bf_svx/source/items/svx_algitem.cxx | 511 ++ bf_svx/source/items/svx_bulitem.cxx | 278 + bf_svx/source/items/svx_chrtitem.cxx | 297 + bf_svx/source/items/svx_clipfmtitem.cxx | 109 + bf_svx/source/items/svx_drawitem.cxx | 267 + bf_svx/source/items/svx_e3ditem.cxx | 136 + bf_svx/source/items/svx_flditem.cxx | 643 ++ bf_svx/source/items/svx_frmitems.cxx | 2542 ++++++++ bf_svx/source/items/svx_grfitem.cxx | 161 + bf_svx/source/items/svx_numitem.cxx | 751 +++ bf_svx/source/items/svx_pageitem.cxx | 261 + bf_svx/source/items/svx_paperinf.cxx | 179 + bf_svx/source/items/svx_paraitem.cxx | 1031 ++++ bf_svx/source/items/svx_postattr.cxx | 51 + bf_svx/source/items/svx_rotmodit.cxx | 133 + bf_svx/source/items/svx_svxerr.cxx | 52 + bf_svx/source/items/svx_svxerr.src | 245 + bf_svx/source/items/svx_svxfont.cxx | 280 + bf_svx/source/items/svx_svxitems.src | 500 ++ bf_svx/source/items/svx_textitem.cxx | 2152 +++++++ bf_svx/source/items/svx_writingmodeitem.cxx | 91 + bf_svx/source/items/svx_xmlcnitm.cxx | 238 + bf_svx/source/items/svx_zoomitem.cxx | 98 + bf_svx/source/options/makefile.mk | 54 + bf_svx/source/options/svx_adritem.cxx | 206 + bf_svx/source/options/svx_asiancfg.cxx | 171 + bf_svx/source/options/svx_optdll.cxx | 75 + bf_svx/source/options/svx_optgrid.cxx | 66 + bf_svx/source/outliner/makefile.mk | 55 + bf_svx/source/outliner/outl_pch.hxx | 37 + bf_svx/source/outliner/outleeng.hxx | 70 + bf_svx/source/outliner/outliner.hrc | 44 + bf_svx/source/outliner/paralist.hxx | 90 + bf_svx/source/outliner/svx_outleeng.cxx | 145 + bf_svx/source/outliner/svx_outlin2.cxx | 408 ++ bf_svx/source/outliner/svx_outliner.cxx | 1199 ++++ bf_svx/source/outliner/svx_outliner.src | 184 + bf_svx/source/outliner/svx_outlobj.cxx | 236 + bf_svx/source/outliner/svx_outlvw.cxx | 74 + bf_svx/source/outliner/svx_paralist.cxx | 91 + bf_svx/source/svdraw/makefile.mk | 121 + bf_svx/source/svdraw/svditext.hxx | 58 + bf_svx/source/svdraw/svdtxhdl.hxx | 108 + bf_svx/source/svdraw/svx_dialdll.cxx | 92 + bf_svx/source/svdraw/svx_impgrfll.cxx | 89 + bf_svx/source/svdraw/svx_svdattr.cxx | 1411 +++++ bf_svx/source/svdraw/svx_svdcrtv.cxx | 222 + bf_svx/source/svdraw/svx_svddrgv.cxx | 135 + bf_svx/source/svdraw/svx_svdedtv.cxx | 184 + bf_svx/source/svdraw/svx_svdedtv2.cxx | 63 + bf_svx/source/svdraw/svx_svdedxv.cxx | 129 + bf_svx/source/svdraw/svx_svdetc.cxx | 540 ++ bf_svx/source/svdraw/svx_svdglev.cxx | 51 + bf_svx/source/svdraw/svx_svdglue.cxx | 225 + bf_svx/source/svdraw/svx_svdhdl.cxx | 77 + bf_svx/source/svdraw/svx_svdhlpln.cxx | 101 + bf_svx/source/svdraw/svx_svdio.cxx | 461 ++ bf_svx/source/svdraw/svx_svditer.cxx | 72 + bf_svx/source/svdraw/svx_svdlayer.cxx | 381 ++ bf_svx/source/svdraw/svx_svdmark.cxx | 159 + bf_svx/source/svdraw/svx_svdmodel.cxx | 1906 ++++++ bf_svx/source/svdraw/svx_svdmrkv.cxx | 530 ++ bf_svx/source/svdraw/svx_svdmrkv1.cxx | 77 + bf_svx/source/svdraw/svx_svdoattr.cxx | 795 +++ bf_svx/source/svdraw/svx_svdobj.cxx | 3047 ++++++++++ bf_svx/source/svdraw/svx_svdocapt.cxx | 468 ++ bf_svx/source/svdraw/svx_svdocirc.cxx | 825 +++ bf_svx/source/svdraw/svx_svdoedge.cxx | 1799 ++++++ bf_svx/source/svdraw/svx_svdograf.cxx | 1395 +++++ bf_svx/source/svdraw/svx_svdogrp.cxx | 710 +++ bf_svx/source/svdraw/svx_svdomeas.cxx | 900 +++ bf_svx/source/svdraw/svx_svdoole2.cxx | 712 +++ bf_svx/source/svdraw/svx_svdopage.cxx | 238 + bf_svx/source/svdraw/svx_svdopath.cxx | 883 +++ bf_svx/source/svdraw/svx_svdorect.cxx | 554 ++ bf_svx/source/svdraw/svx_svdotext.cxx | 1370 +++++ bf_svx/source/svdraw/svx_svdotxat.cxx | 482 ++ bf_svx/source/svdraw/svx_svdotxed.cxx | 73 + bf_svx/source/svdraw/svx_svdotxfl.cxx | 60 + bf_svx/source/svdraw/svx_svdotxln.cxx | 276 + bf_svx/source/svdraw/svx_svdotxtr.cxx | 301 + bf_svx/source/svdraw/svx_svdouno.cxx | 451 ++ bf_svx/source/svdraw/svx_svdoutl.cxx | 127 + bf_svx/source/svdraw/svx_svdoutlinercache.cxx | 111 + bf_svx/source/svdraw/svx_svdovirt.cxx | 270 + bf_svx/source/svdraw/svx_svdpage.cxx | 1453 +++++ bf_svx/source/svdraw/svx_svdpagv.cxx | 719 +++ bf_svx/source/svdraw/svx_svdpntv.cxx | 610 ++ bf_svx/source/svdraw/svx_svdpoev.cxx | 163 + bf_svx/source/svdraw/svx_svdsnpv.cxx | 277 + bf_svx/source/svdraw/svx_svdstr.src | 378 ++ bf_svx/source/svdraw/svx_svdsuro.cxx | 216 + bf_svx/source/svdraw/svx_svdtouch.cxx | 283 + bf_svx/source/svdraw/svx_svdtrans.cxx | 415 ++ bf_svx/source/svdraw/svx_svdtxhdl.cxx | 341 ++ bf_svx/source/svdraw/svx_svdundo.cxx | 156 + bf_svx/source/svdraw/svx_svdview.cxx | 225 + bf_svx/source/svdraw/svx_svdviter.cxx | 196 + bf_svx/source/svdraw/svx_svdvmark.cxx | 92 + bf_svx/source/svdraw/svx_svdxcgv.cxx | 49 + bf_svx/source/svxlink/fileobj.hxx | 90 + bf_svx/source/svxlink/makefile.mk | 69 + bf_svx/source/svxlink/svx_fileobj.cxx | 543 ++ bf_svx/source/svxlink/svx_linkmgr.cxx | 222 + bf_svx/source/svxlink/svx_linkmgr.src | 117 + bf_svx/source/unodraw/UnoGraphicExporter.hxx | 45 + bf_svx/source/unodraw/UnoNameItemTable.hxx | 95 + bf_svx/source/unodraw/makefile.mk | 75 + bf_svx/source/unodraw/shapeimpl.hxx | 144 + .../source/unodraw/svx_UnoNameItemTable.cxx | 335 + bf_svx/source/unodraw/svx_UnoNamespaceMap.cxx | 316 + bf_svx/source/unodraw/svx_XPropertyTable.cxx | 734 +++ bf_svx/source/unodraw/svx_gluepts.cxx | 554 ++ bf_svx/source/unodraw/svx_unobtabl.cxx | 143 + bf_svx/source/unodraw/svx_unoctabl.cxx | 279 + bf_svx/source/unodraw/svx_unodtabl.cxx | 112 + bf_svx/source/unodraw/svx_unofdesc.cxx | 266 + bf_svx/source/unodraw/svx_unogtabl.cxx | 107 + bf_svx/source/unodraw/svx_unohtabl.cxx | 105 + bf_svx/source/unodraw/svx_unoipset.cxx | 666 ++ bf_svx/source/unodraw/svx_unomlstr.cxx | 67 + bf_svx/source/unodraw/svx_unomod.cxx | 737 +++ bf_svx/source/unodraw/svx_unomtabl.cxx | 479 ++ bf_svx/source/unodraw/svx_unonrule.cxx | 599 ++ bf_svx/source/unodraw/svx_unontabl.cxx | 299 + bf_svx/source/unodraw/svx_unopage.cxx | 793 +++ bf_svx/source/unodraw/svx_unopool.cxx | 409 ++ bf_svx/source/unodraw/svx_unoprov.cxx | 1244 ++++ bf_svx/source/unodraw/svx_unoshap2.cxx | 1784 ++++++ bf_svx/source/unodraw/svx_unoshap3.cxx | 1118 ++++ bf_svx/source/unodraw/svx_unoshap4.cxx | 750 +++ bf_svx/source/unodraw/svx_unoshape.cxx | 3758 ++++++++++++ bf_svx/source/unodraw/svx_unoshcol.cxx | 247 + bf_svx/source/unodraw/svx_unoshtxt.cxx | 954 +++ bf_svx/source/unodraw/svx_unottabl.cxx | 110 + bf_svx/source/unoedit/makefile.mk | 61 + .../unoedit/svx_UnoForbiddenCharsTable.cxx | 147 + bf_svx/source/unoedit/svx_unoedhlp.cxx | 78 + bf_svx/source/unoedit/svx_unoedprx.cxx | 1162 ++++ bf_svx/source/unoedit/svx_unoedsrc.cxx | 76 + bf_svx/source/unoedit/svx_unofield.cxx | 820 +++ bf_svx/source/unoedit/svx_unofored.cxx | 382 ++ bf_svx/source/unoedit/svx_unoforou.cxx | 492 ++ bf_svx/source/unoedit/svx_unotext.cxx | 2152 +++++++ bf_svx/source/unoedit/svx_unotext2.cxx | 640 ++ bf_svx/source/unoedit/svx_unoviwed.cxx | 138 + bf_svx/source/unoedit/svx_unoviwou.cxx | 149 + bf_svx/source/xml/editsource.hxx | 56 + bf_svx/source/xml/makefile.mk | 55 + bf_svx/source/xml/svx_xmleohlp.cxx | 730 +++ bf_svx/source/xml/svx_xmlgrhlp.cxx | 797 +++ bf_svx/source/xml/svx_xmltxtexp.cxx | 170 + bf_svx/source/xml/svx_xmltxtimp.cxx | 113 + bf_svx/source/xml/svx_xmlxtexp.cxx | 87 + bf_svx/source/xml/svx_xmlxtimp.cxx | 367 ++ bf_svx/source/xoutdev/makefile.mk | 69 + bf_svx/source/xoutdev/svx__xfont.cxx | 629 ++ bf_svx/source/xoutdev/svx__ximp.cxx | 183 + bf_svx/source/xoutdev/svx__xoutbmp.cxx | 38 + bf_svx/source/xoutdev/svx__xpoly.cxx | 1568 +++++ bf_svx/source/xoutdev/svx_xattr.cxx | 3944 ++++++++++++ bf_svx/source/xoutdev/svx_xattr2.cxx | 720 +++ bf_svx/source/xoutdev/svx_xattrbmp.cxx | 630 ++ bf_svx/source/xoutdev/svx_xfontmac.cxx | 1651 +++++ bf_svx/source/xoutdev/svx_xiocomp.cxx | 68 + bf_svx/source/xoutdev/svx_xline.cxx | 669 ++ bf_svx/source/xoutdev/svx_xout.cxx | 695 +++ bf_svx/source/xoutdev/svx_xout1.cxx | 59 + bf_svx/source/xoutdev/svx_xpool.cxx | 386 ++ bf_svx/source/xoutdev/svx_xtabbtmp.cxx | 387 ++ bf_svx/source/xoutdev/svx_xtabcolr.cxx | 595 ++ bf_svx/source/xoutdev/svx_xtabdash.cxx | 392 ++ bf_svx/source/xoutdev/svx_xtabgrdt.cxx | 433 ++ bf_svx/source/xoutdev/svx_xtabhtch.cxx | 375 ++ bf_svx/source/xoutdev/svx_xtable.cxx | 241 + bf_svx/source/xoutdev/svx_xtablend.cxx | 403 ++ bf_svx/util/bf_sfxwin.flt | 183 + bf_svx/util/bf_svx.component | 46 + bf_svx/util/bf_svx.flt | 132 + bf_svx/util/dl.flt | 138 + bf_svx/util/gal.dxp | 20 + bf_svx/util/hidother.hrc | 27 + bf_svx/util/makefile.mk | 151 + bf_svx/util/svx.dxp | 1 + bf_svx/util/svx_hidother.src | 388 ++ bf_svx/util/svx_svxpch.cxx | 72 + bf_sw/source/core/attr/makefile.mk | 64 + bf_sw/source/core/attr/sw_calbck.cxx | 603 ++ bf_sw/source/core/attr/sw_cellatr.cxx | 155 + bf_sw/source/core/attr/sw_format.cxx | 622 ++ bf_sw/source/core/attr/sw_hints.cxx | 298 + bf_sw/source/core/attr/sw_swatrset.cxx | 292 + bf_sw/source/core/bastyp/makefile.mk | 73 + bf_sw/source/core/bastyp/sw_bparr.cxx | 584 ++ bf_sw/source/core/bastyp/sw_breakit.cxx | 108 + bf_sw/source/core/bastyp/sw_calc.cxx | 1592 +++++ bf_sw/source/core/bastyp/sw_checkit.cxx | 56 + bf_sw/source/core/bastyp/sw_index.cxx | 389 ++ bf_sw/source/core/bastyp/sw_init.cxx | 858 +++ bf_sw/source/core/bastyp/sw_ring.cxx | 98 + bf_sw/source/core/bastyp/sw_swcache.cxx | 494 ++ bf_sw/source/core/bastyp/sw_swrect.cxx | 278 + bf_sw/source/core/bastyp/sw_swregion.cxx | 43 + bf_sw/source/core/bastyp/sw_swtypes.cxx | 145 + bf_sw/source/core/crsr/makefile.mk | 60 + bf_sw/source/core/crsr/sw_bookmrk.cxx | 99 + bf_sw/source/core/crsr/sw_crsrsh.cxx | 159 + bf_sw/source/core/crsr/sw_pam.cxx | 576 ++ bf_sw/source/core/crsr/sw_paminit.cxx | 82 + bf_sw/source/core/crsr/sw_splcstk.cxx | 154 + bf_sw/source/core/crsr/sw_swcrsr.cxx | 300 + bf_sw/source/core/crsr/sw_trvltbl.cxx | 132 + bf_sw/source/core/crsr/sw_unocrsr.cxx | 183 + bf_sw/source/core/crsr/sw_viscrs.cxx | 116 + bf_sw/source/core/doc/makefile.mk | 86 + .../source/core/doc/sw_SwStyleNameMapper.cxx | 984 +++ bf_sw/source/core/doc/sw_doc.cxx | 513 ++ bf_sw/source/core/doc/sw_docbm.cxx | 740 +++ bf_sw/source/core/doc/sw_docchart.cxx | 47 + bf_sw/source/core/doc/sw_doccorr.cxx | 339 ++ bf_sw/source/core/doc/sw_docdde.cxx | 217 + bf_sw/source/core/doc/sw_docdesc.cxx | 573 ++ bf_sw/source/core/doc/sw_docdraw.cxx | 365 ++ bf_sw/source/core/doc/sw_docedt.cxx | 552 ++ bf_sw/source/core/doc/sw_docfld.cxx | 1505 +++++ bf_sw/source/core/doc/sw_docfly.cxx | 751 +++ bf_sw/source/core/doc/sw_docfmt.cxx | 1203 ++++ bf_sw/source/core/doc/sw_docftn.cxx | 391 ++ bf_sw/source/core/doc/sw_doclay.cxx | 955 +++ bf_sw/source/core/doc/sw_docnew.cxx | 711 +++ bf_sw/source/core/doc/sw_docnum.cxx | 847 +++ bf_sw/source/core/doc/sw_docredln.cxx | 370 ++ bf_sw/source/core/doc/sw_docruby.cxx | 57 + bf_sw/source/core/doc/sw_docstat.cxx | 73 + bf_sw/source/core/doc/sw_doctxm.cxx | 360 ++ bf_sw/source/core/doc/sw_fmtcol.cxx | 283 + bf_sw/source/core/doc/sw_ftnidx.cxx | 399 ++ bf_sw/source/core/doc/sw_gctable.cxx | 469 ++ bf_sw/source/core/doc/sw_lineinfo.cxx | 124 + bf_sw/source/core/doc/sw_notxtfrm.cxx | 274 + bf_sw/source/core/doc/sw_number.cxx | 567 ++ bf_sw/source/core/doc/sw_numpara.cxx | 247 + bf_sw/source/core/doc/sw_poolfmt.cxx | 2102 +++++++ bf_sw/source/core/doc/sw_sortopt.cxx | 100 + bf_sw/source/core/doc/sw_swserv.cxx | 166 + bf_sw/source/core/doc/sw_swtable.cxx | 951 +++ bf_sw/source/core/doc/sw_tblafmt.cxx | 83 + bf_sw/source/core/doc/sw_tblrwcl.cxx | 780 +++ bf_sw/source/core/doc/sw_visiturl.cxx | 103 + bf_sw/source/core/docnode/makefile.mk | 82 + bf_sw/source/core/docnode/sw_ndarr.cxx | 73 + bf_sw/source/core/docnode/sw_ndcopy.cxx | 473 ++ bf_sw/source/core/docnode/sw_ndindex.cxx | 155 + bf_sw/source/core/docnode/sw_ndnotxt.cxx | 198 + bf_sw/source/core/docnode/sw_ndnum.cxx | 369 ++ bf_sw/source/core/docnode/sw_ndsect.cxx | 861 +++ bf_sw/source/core/docnode/sw_ndtbl.cxx | 736 +++ bf_sw/source/core/docnode/sw_ndtbl1.cxx | 404 ++ bf_sw/source/core/docnode/sw_node.cxx | 1191 ++++ bf_sw/source/core/docnode/sw_node2lay.cxx | 356 ++ bf_sw/source/core/docnode/sw_nodes.cxx | 1128 ++++ bf_sw/source/core/docnode/sw_section.cxx | 1089 ++++ bf_sw/source/core/docnode/sw_swbaslnk.cxx | 414 ++ bf_sw/source/core/draw/makefile.mk | 54 + bf_sw/source/core/draw/sw_dcontact.cxx | 1245 ++++ bf_sw/source/core/draw/sw_dflyobj.cxx | 230 + bf_sw/source/core/draw/sw_dobjfac.cxx | 58 + bf_sw/source/core/draw/sw_dpage.cxx | 100 + bf_sw/source/core/draw/sw_drawdoc.cxx | 308 + bf_sw/source/core/draw/sw_dview.cxx | 144 + bf_sw/source/core/fields/makefile.mk | 66 + bf_sw/source/core/fields/sw_authfld.cxx | 715 +++ bf_sw/source/core/fields/sw_cellfml.cxx | 557 ++ bf_sw/source/core/fields/sw_chpfld.cxx | 260 + bf_sw/source/core/fields/sw_dbfld.cxx | 913 +++ bf_sw/source/core/fields/sw_ddefld.cxx | 261 + bf_sw/source/core/fields/sw_ddetbl.cxx | 52 + bf_sw/source/core/fields/sw_docufld.cxx | 2102 +++++++ bf_sw/source/core/fields/sw_expfld.cxx | 1109 ++++ bf_sw/source/core/fields/sw_fldbas.cxx | 579 ++ bf_sw/source/core/fields/sw_flddat.cxx | 300 + bf_sw/source/core/fields/sw_flddropdown.cxx | 225 + bf_sw/source/core/fields/sw_inetfld.cxx | 241 + bf_sw/source/core/fields/sw_macrofld.cxx | 206 + bf_sw/source/core/fields/sw_reffld.cxx | 732 +++ bf_sw/source/core/fields/sw_scrptfld.cxx | 148 + bf_sw/source/core/fields/sw_tblcalc.cxx | 269 + bf_sw/source/core/fields/sw_usrfld.cxx | 365 ++ bf_sw/source/core/frmedt/makefile.mk | 58 + bf_sw/source/core/frmedt/sw_fefly1.cxx | 185 + bf_sw/source/core/frmedt/sw_fetab.cxx | 66 + bf_sw/source/core/frmedt/sw_fews.cxx | 63 + bf_sw/source/core/frmedt/sw_tblsel.cxx | 784 +++ bf_sw/source/core/graphic/makefile.mk | 56 + bf_sw/source/core/graphic/sw_grfatr.cxx | 361 ++ bf_sw/source/core/graphic/sw_ndgrf.cxx | 660 ++ bf_sw/source/core/inc/GetMetricVal.hxx | 51 + bf_sw/source/core/inc/SwXTextDefaults.hxx | 90 + bf_sw/source/core/inc/atrhndl.hxx | 171 + bf_sw/source/core/inc/blink.hxx | 66 + bf_sw/source/core/inc/bodyfrm.hxx | 55 + bf_sw/source/core/inc/cellfrm.hxx | 60 + bf_sw/source/core/inc/cntfrm.hxx | 121 + bf_sw/source/core/inc/colfrm.hxx | 49 + bf_sw/source/core/inc/dflyobj.hxx | 109 + bf_sw/source/core/inc/docfld.hxx | 173 + bf_sw/source/core/inc/docfunc.hxx | 74 + bf_sw/source/core/inc/doctxm.hxx | 120 + bf_sw/source/core/inc/drawfont.hxx | 807 +++ bf_sw/source/core/inc/dview.hxx | 69 + bf_sw/source/core/inc/flowfrm.hxx | 196 + bf_sw/source/core/inc/flyfrm.hxx | 224 + bf_sw/source/core/inc/flyfrms.hxx | 171 + bf_sw/source/core/inc/fntcache.hxx | 157 + bf_sw/source/core/inc/frame.hxx | 1077 ++++ bf_sw/source/core/inc/frmtool.hxx | 447 ++ bf_sw/source/core/inc/ftnboss.hxx | 130 + bf_sw/source/core/inc/ftnfrm.hxx | 128 + bf_sw/source/core/inc/hffrm.hxx | 73 + bf_sw/source/core/inc/laycache.hxx | 71 + bf_sw/source/core/inc/layfrm.hxx | 171 + bf_sw/source/core/inc/mvsave.hxx | 214 + bf_sw/source/core/inc/node2lay.hxx | 84 + bf_sw/source/core/inc/noteurl.hxx | 79 + bf_sw/source/core/inc/notxtfrm.hxx | 84 + bf_sw/source/core/inc/numpara.hxx | 74 + bf_sw/source/core/inc/pagefrm.hxx | 433 ++ bf_sw/source/core/inc/pamtyp.hxx | 89 + bf_sw/source/core/inc/prevwpage.hxx | 41 + bf_sw/source/core/inc/ptqueue.hxx | 65 + bf_sw/source/core/inc/rootfrm.hxx | 87 + bf_sw/source/core/inc/rowfrm.hxx | 78 + bf_sw/source/core/inc/scrrect.hxx | 144 + bf_sw/source/core/inc/sectfrm.hxx | 154 + bf_sw/source/core/inc/splcstk.hxx | 64 + bf_sw/source/core/inc/swcache.hxx | 290 + bf_sw/source/core/inc/swfntcch.hxx | 105 + bf_sw/source/core/inc/swfont.hxx | 860 +++ bf_sw/source/core/inc/tabfrm.hxx | 161 + bf_sw/source/core/inc/tblrwcl.hxx | 220 + bf_sw/source/core/inc/txmsrt.hxx | 197 + bf_sw/source/core/inc/txtfrm.hxx | 690 +++ bf_sw/source/core/inc/txttypes.hxx | 104 + bf_sw/source/core/inc/unoclbck.hxx | 56 + bf_sw/source/core/inc/unofldmid.h | 66 + bf_sw/source/core/inc/viewimp.hxx | 122 + bf_sw/source/core/inc/visiturl.hxx | 53 + bf_sw/source/core/inc/wrong.hxx | 90 + bf_sw/source/core/layout/layhelp.hxx | 175 + bf_sw/source/core/layout/makefile.mk | 118 + bf_sw/source/core/layout/sw_atrfrm.cxx | 2508 ++++++++ bf_sw/source/core/layout/sw_calcmove.cxx | 1408 +++++ bf_sw/source/core/layout/sw_colfrm.cxx | 472 ++ bf_sw/source/core/layout/sw_findfrm.cxx | 1057 ++++ bf_sw/source/core/layout/sw_flowfrm.cxx | 1816 ++++++ bf_sw/source/core/layout/sw_fly.cxx | 1772 ++++++ bf_sw/source/core/layout/sw_flycnt.cxx | 2061 +++++++ bf_sw/source/core/layout/sw_flyincnt.cxx | 338 ++ bf_sw/source/core/layout/sw_flylay.cxx | 970 +++ bf_sw/source/core/layout/sw_frmtool.cxx | 2684 ++++++++ bf_sw/source/core/layout/sw_ftnfrm.cxx | 1941 ++++++ bf_sw/source/core/layout/sw_hffrm.cxx | 769 +++ bf_sw/source/core/layout/sw_laycache.cxx | 609 ++ bf_sw/source/core/layout/sw_newfrm.cxx | 359 ++ bf_sw/source/core/layout/sw_pagechg.cxx | 1291 ++++ bf_sw/source/core/layout/sw_pagedesc.cxx | 329 + bf_sw/source/core/layout/sw_paintfrm.cxx | 39 + bf_sw/source/core/layout/sw_sectfrm.cxx | 1969 ++++++ bf_sw/source/core/layout/sw_ssfrm.cxx | 483 ++ bf_sw/source/core/layout/sw_tabfrm.cxx | 2625 ++++++++ bf_sw/source/core/layout/sw_trvlfrm.cxx | 682 +++ bf_sw/source/core/layout/sw_unusedf.cxx | 65 + bf_sw/source/core/layout/sw_wsfrm.cxx | 3103 ++++++++++ bf_sw/source/core/layout/virtoutp.hxx | 76 + bf_sw/source/core/makefile.mk | 90 + bf_sw/source/core/ole/makefile.mk | 55 + bf_sw/source/core/ole/sw_ndole.cxx | 444 ++ bf_sw/source/core/para/makefile.mk | 55 + bf_sw/source/core/para/sw_paratr.cxx | 298 + bf_sw/source/core/sw3io/crypter.hxx | 54 + bf_sw/source/core/sw3io/makefile.mk | 90 + bf_sw/source/core/sw3io/sw3ids.hxx | 229 + bf_sw/source/core/sw3io/sw3imp.hxx | 738 +++ bf_sw/source/core/sw3io/sw3marks.hxx | 73 + bf_sw/source/core/sw3io/sw_crypter.cxx | 97 + bf_sw/source/core/sw3io/sw_sw3attr.cxx | 736 +++ bf_sw/source/core/sw3io/sw_sw3block.cxx | 109 + bf_sw/source/core/sw3io/sw_sw3doc.cxx | 495 ++ bf_sw/source/core/sw3io/sw_sw3field.cxx | 1849 ++++++ bf_sw/source/core/sw3io/sw_sw3fmts.cxx | 616 ++ bf_sw/source/core/sw3io/sw_sw3imp.cxx | 1728 ++++++ bf_sw/source/core/sw3io/sw_sw3io.cxx | 190 + bf_sw/source/core/sw3io/sw_sw3misc.cxx | 1652 +++++ bf_sw/source/core/sw3io/sw_sw3nodes.cxx | 1689 ++++++ bf_sw/source/core/sw3io/sw_sw3npool.cxx | 684 +++ bf_sw/source/core/sw3io/sw_sw3num.cxx | 996 +++ bf_sw/source/core/sw3io/sw_sw3page.cxx | 468 ++ bf_sw/source/core/sw3io/sw_sw3redln.cxx | 487 ++ bf_sw/source/core/sw3io/sw_sw3sectn.cxx | 465 ++ bf_sw/source/core/sw3io/sw_sw3style.cxx | 1094 ++++ bf_sw/source/core/sw3io/sw_sw3table.cxx | 438 ++ bf_sw/source/core/swg/frmids.hxx | 81 + bf_sw/source/core/swg/makefile.mk | 66 + bf_sw/source/core/swg/oldhntid.hxx | 201 + bf_sw/source/core/swg/rdswg.hxx | 334 + bf_sw/source/core/swg/sw_rdcont.cxx | 652 ++ bf_sw/source/core/swg/sw_rdflds.cxx | 770 +++ bf_sw/source/core/swg/sw_rdfmts.cxx | 1093 ++++ bf_sw/source/core/swg/sw_rdhnt.cxx | 1351 +++++ bf_sw/source/core/swg/sw_rdmisc.cxx | 489 ++ bf_sw/source/core/swg/sw_rdnds.cxx | 777 +++ bf_sw/source/core/swg/sw_rdnum.cxx | 323 + bf_sw/source/core/swg/sw_rdpage.cxx | 388 ++ bf_sw/source/core/swg/sw_rdswg.cxx | 604 ++ bf_sw/source/core/swg/sw_rdtox.cxx | 249 + bf_sw/source/core/swg/sw_swgpar.cxx | 80 + bf_sw/source/core/swg/sw_swgstr.cxx | 256 + bf_sw/source/core/swg/swgids.hxx | 255 + bf_sw/source/core/text/guess.hxx | 85 + bf_sw/source/core/text/inftxt.hxx | 817 +++ bf_sw/source/core/text/itratr.hxx | 148 + bf_sw/source/core/text/itrform2.hxx | 214 + bf_sw/source/core/text/itrpaint.hxx | 66 + bf_sw/source/core/text/itrtxt.hxx | 355 ++ bf_sw/source/core/text/makefile.mk | 107 + bf_sw/source/core/text/pordrop.hxx | 109 + bf_sw/source/core/text/porexp.hxx | 88 + bf_sw/source/core/text/porfld.hxx | 183 + bf_sw/source/core/text/porfly.hxx | 114 + bf_sw/source/core/text/porftn.hxx | 109 + bf_sw/source/core/text/porglue.hxx | 135 + bf_sw/source/core/text/porhyph.hxx | 102 + bf_sw/source/core/text/porlay.hxx | 371 ++ bf_sw/source/core/text/porlin.hxx | 240 + bf_sw/source/core/text/pormulti.hxx | 157 + bf_sw/source/core/text/porref.hxx | 55 + bf_sw/source/core/text/porrst.hxx | 158 + bf_sw/source/core/text/portab.hxx | 123 + bf_sw/source/core/text/portox.hxx | 76 + bf_sw/source/core/text/portxt.hxx | 100 + bf_sw/source/core/text/possiz.hxx | 95 + bf_sw/source/core/text/sw_atrstck.cxx | 694 +++ bf_sw/source/core/text/sw_frmcrsr.cxx | 505 ++ bf_sw/source/core/text/sw_frmform.cxx | 1866 ++++++ bf_sw/source/core/text/sw_guess.cxx | 578 ++ bf_sw/source/core/text/sw_inftxt.cxx | 895 +++ bf_sw/source/core/text/sw_itradj.cxx | 454 ++ bf_sw/source/core/text/sw_itratr.cxx | 287 + bf_sw/source/core/text/sw_itrcrsr.cxx | 1086 ++++ bf_sw/source/core/text/sw_itrform2.cxx | 1776 ++++++ bf_sw/source/core/text/sw_itrpaint.cxx | 98 + bf_sw/source/core/text/sw_itrtxt.cxx | 497 ++ bf_sw/source/core/text/sw_noteurl.cxx | 58 + bf_sw/source/core/text/sw_porexp.cxx | 174 + bf_sw/source/core/text/sw_porfld.cxx | 472 ++ bf_sw/source/core/text/sw_porfly.cxx | 633 ++ bf_sw/source/core/text/sw_porglue.cxx | 229 + bf_sw/source/core/text/sw_porlay.cxx | 986 +++ bf_sw/source/core/text/sw_porlin.cxx | 333 + bf_sw/source/core/text/sw_pormulti.cxx | 132 + bf_sw/source/core/text/sw_porrst.cxx | 346 ++ bf_sw/source/core/text/sw_portox.cxx | 82 + bf_sw/source/core/text/sw_portxt.cxx | 565 ++ bf_sw/source/core/text/sw_redlnitr.cxx | 145 + bf_sw/source/core/text/sw_txtcache.cxx | 217 + bf_sw/source/core/text/sw_txtdrop.cxx | 345 ++ bf_sw/source/core/text/sw_txtfld.cxx | 385 ++ bf_sw/source/core/text/sw_txtfly.cxx | 1778 ++++++ bf_sw/source/core/text/sw_txtfrm.cxx | 1897 ++++++ bf_sw/source/core/text/sw_txtftn.cxx | 1297 ++++ bf_sw/source/core/text/sw_txthyph.cxx | 312 + bf_sw/source/core/text/sw_txtinit.cxx | 104 + bf_sw/source/core/text/sw_txtio.cxx | 723 +++ bf_sw/source/core/text/sw_txttab.cxx | 418 ++ bf_sw/source/core/text/sw_widorp.cxx | 509 ++ bf_sw/source/core/text/sw_wrong.cxx | 118 + bf_sw/source/core/text/txtcache.hxx | 82 + bf_sw/source/core/text/txtcfg.hxx | 59 + bf_sw/source/core/text/txtfly.hxx | 226 + bf_sw/source/core/text/widorp.hxx | 110 + bf_sw/source/core/tox/makefile.mk | 71 + bf_sw/source/core/tox/sw_tox.cxx | 1000 +++ bf_sw/source/core/tox/sw_toxhlp.cxx | 136 + bf_sw/source/core/tox/sw_txmsrt.cxx | 497 ++ bf_sw/source/core/txtnode/makefile.mk | 82 + bf_sw/source/core/txtnode/sw_atrfld.cxx | 261 + bf_sw/source/core/txtnode/sw_atrflyin.cxx | 271 + bf_sw/source/core/txtnode/sw_atrftn.cxx | 412 ++ bf_sw/source/core/txtnode/sw_atrref.cxx | 98 + bf_sw/source/core/txtnode/sw_atrtox.cxx | 99 + bf_sw/source/core/txtnode/sw_fmtatr1.cxx | 78 + bf_sw/source/core/txtnode/sw_fmtatr2.cxx | 504 ++ bf_sw/source/core/txtnode/sw_fntcache.cxx | 638 ++ bf_sw/source/core/txtnode/sw_fntcap.cxx | 532 ++ bf_sw/source/core/txtnode/sw_ndhints.cxx | 391 ++ bf_sw/source/core/txtnode/sw_ndtxt.cxx | 2110 +++++++ bf_sw/source/core/txtnode/sw_swfntcch.cxx | 93 + bf_sw/source/core/txtnode/sw_swfont.cxx | 817 +++ bf_sw/source/core/txtnode/sw_thints.cxx | 1890 ++++++ bf_sw/source/core/txtnode/sw_txatbase.cxx | 76 + bf_sw/source/core/txtnode/sw_txtatr2.cxx | 218 + bf_sw/source/core/txtnode/sw_txtedt.cxx | 346 ++ bf_sw/source/core/unocore/makefile.mk | 123 + .../core/unocore/sw_SwXTextDefaults.cxx | 301 + .../core/unocore/sw_TextCursorHelper.cxx | 60 + bf_sw/source/core/unocore/sw_swunohelper.cxx | 82 + bf_sw/source/core/unocore/sw_unobkm.cxx | 320 + bf_sw/source/core/unocore/sw_unoclbck.cxx | 105 + bf_sw/source/core/unocore/sw_unocoll.cxx | 1528 +++++ .../source/core/unocore/sw_unocrsrhelper.cxx | 725 +++ bf_sw/source/core/unocore/sw_unodraw.cxx | 1604 +++++ bf_sw/source/core/unocore/sw_unoevent.cxx | 359 ++ bf_sw/source/core/unocore/sw_unoevtlstnr.cxx | 113 + bf_sw/source/core/unocore/sw_unofield.cxx | 2570 ++++++++ bf_sw/source/core/unocore/sw_unoframe.cxx | 2760 +++++++++ bf_sw/source/core/unocore/sw_unoftn.cxx | 520 ++ bf_sw/source/core/unocore/sw_unoidx.cxx | 2564 ++++++++ bf_sw/source/core/unocore/sw_unomap.cxx | Bin 0 -> 230048 bytes bf_sw/source/core/unocore/sw_unoobj.cxx | 1955 ++++++ bf_sw/source/core/unocore/sw_unoobj2.cxx | 2069 +++++++ bf_sw/source/core/unocore/sw_unoparagraph.cxx | 756 +++ bf_sw/source/core/unocore/sw_unoport.cxx | 823 +++ bf_sw/source/core/unocore/sw_unoportenum.cxx | 894 +++ bf_sw/source/core/unocore/sw_unoprnms.cxx | 720 +++ bf_sw/source/core/unocore/sw_unoredline.cxx | 694 +++ bf_sw/source/core/unocore/sw_unoredlines.cxx | 215 + bf_sw/source/core/unocore/sw_unorefmk.cxx | 381 ++ bf_sw/source/core/unocore/sw_unosect.cxx | 1360 +++++ bf_sw/source/core/unocore/sw_unosett.cxx | 2367 ++++++++ bf_sw/source/core/unocore/sw_unosrch.cxx | 714 +++ bf_sw/source/core/unocore/sw_unostyle.cxx | 3156 ++++++++++ bf_sw/source/core/unocore/sw_unotbl.cxx | 4379 +++++++++++++ bf_sw/source/core/unocore/sw_unotext.cxx | 1646 +++++ bf_sw/source/core/view/makefile.mk | 66 + bf_sw/source/core/view/sw_viewimp.cxx | 54 + bf_sw/source/core/view/sw_viewsh.cxx | 100 + bf_sw/source/core/view/sw_vnew.cxx | 124 + bf_sw/source/core/view/sw_vprint.cxx | 87 + bf_sw/source/filter/ascii/makefile.mk | 51 + bf_sw/source/filter/ascii/sw_ascatr.cxx | 226 + bf_sw/source/filter/ascii/sw_wrtasc.cxx | 234 + bf_sw/source/filter/ascii/wrtasc.hxx | 57 + bf_sw/source/filter/basflt/makefile.mk | 57 + bf_sw/source/filter/basflt/sw_docfact.cxx | 79 + bf_sw/source/filter/basflt/sw_fltini.cxx | 805 +++ bf_sw/source/filter/basflt/sw_shellio.cxx | 561 ++ bf_sw/source/filter/excel/exccrts.hxx | 216 + bf_sw/source/filter/excel/excdocum.hxx | 114 + bf_sw/source/filter/excel/excfntbf.hxx | 125 + bf_sw/source/filter/excel/excvfbff.hxx | 99 + bf_sw/source/filter/excel/excxfbuf.hxx | 215 + bf_sw/source/filter/excel/exlpar.hxx | 197 + bf_sw/source/filter/excel/makefile.mk | 64 + bf_sw/source/filter/excel/sw_excimpop.cxx | 1505 +++++ bf_sw/source/filter/excel/sw_excread.cxx | 432 ++ bf_sw/source/filter/excel/sw_exctools.cxx | 1887 ++++++ bf_sw/source/filter/excel/sw_exlpar.cxx | 229 + bf_sw/source/filter/excel/sw_fltglbls.cxx | 156 + bf_sw/source/filter/inc/SwAppletImpl.hxx | 67 + bf_sw/source/filter/inc/fltbase.hxx | 132 + bf_sw/source/filter/inc/fltglbls.hxx | 184 + bf_sw/source/filter/inc/fltini.hxx | 109 + bf_sw/source/filter/inc/wrt_fn.hxx | 76 + bf_sw/source/filter/inc/wrtswtbl.hxx | 118 + bf_sw/source/filter/lotus/lotpar.hxx | 90 + bf_sw/source/filter/lotus/makefile.mk | 60 + bf_sw/source/filter/lotus/sw_lotimpop.cxx | 224 + bf_sw/source/filter/lotus/sw_lotpar.cxx | 143 + bf_sw/source/filter/lotus/sw_lotread.cxx | 117 + bf_sw/source/filter/makefile.mk | 68 + bf_sw/source/filter/sw6/makefile.mk | 57 + bf_sw/source/filter/sw6/sw6file.hxx | 453 ++ bf_sw/source/filter/sw6/sw6par.hxx | 215 + bf_sw/source/filter/sw6/sw_sw6file.cxx | 442 ++ bf_sw/source/filter/sw6/sw_sw6par.cxx | Bin 0 -> 238449 bytes bf_sw/source/filter/writer/makefile.mk | 57 + bf_sw/source/filter/writer/sw_writer.cxx | 361 ++ bf_sw/source/filter/writer/sw_wrt_fn.cxx | 129 + bf_sw/source/filter/writer/sw_wrtswtbl.cxx | 66 + .../filter/xml/ForbiddenCharactersEnum.hxx | 46 + .../filter/xml/XMLRedlineImportHelper.hxx | 175 + bf_sw/source/filter/xml/makefile.mk | 116 + .../filter/xml/sw_XMLRedlineImportHelper.cxx | 730 +++ bf_sw/source/filter/xml/sw_swxmlat.cxx | 376 ++ bf_sw/source/filter/xml/sw_xmlbrsh.cxx | 259 + bf_sw/source/filter/xml/sw_xmlexp.cxx | 856 +++ bf_sw/source/filter/xml/sw_xmlexpit.cxx | 984 +++ bf_sw/source/filter/xml/sw_xmlfmt.cxx | 1123 ++++ bf_sw/source/filter/xml/sw_xmlfmte.cxx | 362 ++ bf_sw/source/filter/xml/sw_xmlfonte.cxx | 119 + bf_sw/source/filter/xml/sw_xmlimp.cxx | 1284 ++++ bf_sw/source/filter/xml/sw_xmlimpit.cxx | 932 +++ bf_sw/source/filter/xml/sw_xmlitem.cxx | 95 + bf_sw/source/filter/xml/sw_xmliteme.cxx | 269 + bf_sw/source/filter/xml/sw_xmlitemi.cxx | 276 + bf_sw/source/filter/xml/sw_xmlitemm.cxx | 291 + bf_sw/source/filter/xml/sw_xmlithlp.cxx | 423 ++ bf_sw/source/filter/xml/sw_xmlitmpr.cxx | 94 + bf_sw/source/filter/xml/sw_xmlmeta.cxx | 266 + bf_sw/source/filter/xml/sw_xmlscript.cxx | 78 + bf_sw/source/filter/xml/sw_xmltble.cxx | 1175 ++++ bf_sw/source/filter/xml/sw_xmltbli.cxx | 2615 ++++++++ bf_sw/source/filter/xml/sw_xmltext.cxx | 111 + bf_sw/source/filter/xml/sw_xmltexte.cxx | 613 ++ bf_sw/source/filter/xml/sw_xmltexti.cxx | 788 +++ bf_sw/source/filter/xml/xmlbrshe.hxx | 60 + bf_sw/source/filter/xml/xmlbrshi.hxx | 89 + bf_sw/source/filter/xml/xmlexp.hxx | 201 + bf_sw/source/filter/xml/xmlexpit.hxx | 141 + bf_sw/source/filter/xml/xmlimp.hxx | 216 + bf_sw/source/filter/xml/xmlimpit.hxx | 120 + bf_sw/source/filter/xml/xmlitem.hxx | 88 + bf_sw/source/filter/xml/xmlithlp.hxx | 108 + bf_sw/source/filter/xml/xmlitmap.hxx | 103 + bf_sw/source/filter/xml/xmltbli.hxx | 222 + bf_sw/source/filter/xml/xmltexte.hxx | 93 + bf_sw/source/filter/xml/xmltexti.hxx | 134 + bf_sw/source/ui/app/makefile.mk | 91 + bf_sw/source/ui/app/sw_app.src | 838 +++ bf_sw/source/ui/app/sw_apphdl.cxx | 155 + bf_sw/source/ui/app/sw_docsh.cxx | 551 ++ bf_sw/source/ui/app/sw_docsh2.cxx | 226 + bf_sw/source/ui/app/sw_docshdrw.cxx | 82 + bf_sw/source/ui/app/sw_docshini.cxx | 728 +++ bf_sw/source/ui/app/sw_docstyle.cxx | 1583 +++++ bf_sw/source/ui/app/sw_error.src | 1428 +++++ bf_sw/source/ui/app/sw_mainwn.cxx | 138 + bf_sw/source/ui/app/sw_swcomlib.cxx | 238 + bf_sw/source/ui/app/sw_swdll.cxx | 110 + bf_sw/source/ui/app/sw_swlib.cxx | 152 + bf_sw/source/ui/app/sw_swmodul1.cxx | 185 + bf_sw/source/ui/app/sw_swmodule.cxx | 218 + bf_sw/source/ui/config/config.hrc | 64 + bf_sw/source/ui/config/makefile.mk | 63 + bf_sw/source/ui/config/optload.hrc | 79 + bf_sw/source/ui/config/sw_caption.cxx | 103 + bf_sw/source/ui/config/sw_dbconfig.cxx | 133 + bf_sw/source/ui/config/sw_fontcfg.cxx | 237 + bf_sw/source/ui/config/sw_modcfg.cxx | 772 +++ bf_sw/source/ui/config/sw_optload.src | 359 ++ bf_sw/source/ui/config/sw_prtopt.cxx | 138 + bf_sw/source/ui/config/sw_swlinguconfig.cxx | 74 + bf_sw/source/ui/config/sw_usrpref.cxx | 503 ++ bf_sw/source/ui/config/sw_viewopt.cxx | 277 + bf_sw/source/ui/dbui/makefile.mk | 55 + bf_sw/source/ui/dbui/sw_dbmgr.cxx | 617 ++ bf_sw/source/ui/dialog/makefile.mk | 53 + bf_sw/source/ui/dialog/regionsw.hrc | 103 + bf_sw/source/ui/dialog/sw_regionsw.src | 401 ++ bf_sw/source/ui/fldui/fldui.hrc | 198 + bf_sw/source/ui/fldui/makefile.mk | 56 + bf_sw/source/ui/fldui/sw_fldmgr.cxx | 271 + bf_sw/source/ui/fldui/sw_fldui.src | 1575 +++++ bf_sw/source/ui/globdoc/makefile.mk | 58 + bf_sw/source/ui/globdoc/sw_globdoc.cxx | 108 + bf_sw/source/ui/globdoc/sw_globdoc.src | 96 + bf_sw/source/ui/inc/SwXFilterOptions.hxx | 118 + bf_sw/source/ui/inc/app.hrc | 160 + bf_sw/source/ui/inc/barcfg.hxx | 54 + bf_sw/source/ui/inc/caption.hxx | 105 + bf_sw/source/ui/inc/ccoll.hxx | 81 + bf_sw/source/ui/inc/cfgid.h | 48 + bf_sw/source/ui/inc/content.hxx | 135 + bf_sw/source/ui/inc/dbconfig.hxx | 52 + bf_sw/source/ui/inc/edtwin.hxx | 222 + bf_sw/source/ui/inc/fldmgr.hxx | 262 + bf_sw/source/ui/inc/fontcfg.hxx | 109 + bf_sw/source/ui/inc/globals.h | 40 + bf_sw/source/ui/inc/globdoc.hrc | 74 + bf_sw/source/ui/inc/glshell.hxx | 73 + bf_sw/source/ui/inc/misc.hrc | 78 + bf_sw/source/ui/inc/modcfg.hxx | 317 + bf_sw/source/ui/inc/numpara.hxx | 92 + bf_sw/source/ui/inc/popup.hrc | 50 + bf_sw/source/ui/inc/prtopt.hxx | 59 + bf_sw/source/ui/inc/shells.hrc | 63 + bf_sw/source/ui/inc/swcont.hxx | 119 + bf_sw/source/ui/inc/swlinguconfig.hxx | 55 + bf_sw/source/ui/inc/toolbox.hrc | 658 ++ bf_sw/source/ui/inc/uiitems.hxx | 85 + bf_sw/source/ui/inc/uiparam.hxx | 66 + bf_sw/source/ui/inc/uitool.hxx | 63 + bf_sw/source/ui/inc/usrpref.hxx | 257 + bf_sw/source/ui/inc/utlui.hrc | 131 + bf_sw/source/ui/inc/web.hrc | 80 + bf_sw/source/ui/inc/zoomctrl.hxx | 54 + bf_sw/source/ui/index/cnttab.hrc | 278 + bf_sw/source/ui/index/index.hrc | 48 + bf_sw/source/ui/index/makefile.mk | 56 + bf_sw/source/ui/index/sw_cnttab.src | 73 + bf_sw/source/ui/index/sw_toxmgr.cxx | 63 + bf_sw/source/ui/makefile.mk | 78 + bf_sw/source/ui/misc/makefile.mk | 52 + bf_sw/source/ui/misc/redlndlg.hrc | 38 + bf_sw/source/ui/misc/sw_redlndlg.src | 76 + bf_sw/source/ui/shells/makefile.mk | 55 + bf_sw/source/ui/shells/sw_pseudo.src | 162 + bf_sw/source/ui/shells/sw_shells.src | 355 ++ bf_sw/source/ui/uno/SwXDocumentSettings.hxx | 109 + .../source/ui/uno/SwXPrintPreviewSettings.hxx | 95 + bf_sw/source/ui/uno/makefile.mk | 61 + .../ui/uno/sw_RefreshListenerContainer.cxx | 63 + .../source/ui/uno/sw_SwXDocumentSettings.cxx | 677 +++ bf_sw/source/ui/uno/sw_SwXFilterOptions.cxx | 184 + .../ui/uno/sw_SwXPrintPreviewSettings.cxx | 375 ++ bf_sw/source/ui/uno/sw_unodefaults.cxx | 68 + bf_sw/source/ui/uno/sw_unodoc.cxx | 169 + bf_sw/source/ui/uno/sw_unofreg.cxx | 250 + bf_sw/source/ui/uno/sw_unomod.cxx | 756 +++ bf_sw/source/ui/uno/sw_unotxdoc.cxx | 2540 ++++++++ bf_sw/source/ui/uno/unodefaults.hxx | 52 + bf_sw/source/ui/utlui/attrdesc.hrc | 37 + bf_sw/source/ui/utlui/gloslst.hrc | 38 + bf_sw/source/ui/utlui/initui.hrc | 61 + bf_sw/source/ui/utlui/makefile.mk | 65 + bf_sw/source/ui/utlui/navipi.hrc | 92 + bf_sw/source/ui/utlui/sw_attrdesc.cxx | 74 + bf_sw/source/ui/utlui/sw_attrdesc.src | 47 + bf_sw/source/ui/utlui/sw_gloslst.src | 60 + bf_sw/source/ui/utlui/sw_initui.cxx | 130 + bf_sw/source/ui/utlui/sw_initui.src | 1872 ++++++ bf_sw/source/ui/utlui/sw_navipi.src | 88 + bf_sw/source/ui/utlui/sw_poolfmt.src | 740 +++ bf_sw/source/ui/utlui/sw_uiitems.cxx | 186 + bf_sw/source/ui/utlui/sw_uitool.cxx | 419 ++ bf_sw/source/ui/utlui/sw_utlui.src | 841 +++ bf_sw/source/ui/web/makefile.mk | 52 + bf_sw/source/ui/web/sw_wdocsh.cxx | 84 + bf_sw/util/bf_sw.component | 73 + bf_sw/util/bf_sw.map | 14 + bf_sw/util/hidother.hrc | 31 + bf_sw/util/makefile.mk | 199 + bf_sw/util/sw_hidother.src | 328 + .../source/chart/MultiPropertySetHandler.hxx | 297 + bf_xmloff/source/chart/PropertyMap.hxx | 225 + .../source/chart/SchXMLAutoStylePoolP.hxx | 58 + bf_xmloff/source/chart/SchXMLChartContext.hxx | 161 + .../source/chart/SchXMLParagraphContext.hxx | 67 + .../source/chart/SchXMLPlotAreaContext.hxx | 335 + bf_xmloff/source/chart/SchXMLTableContext.hxx | 205 + .../source/chart/XMLChartPropertyContext.hxx | 62 + .../chart/XMLErrorIndicatorPropertyHdl.hxx | 51 + .../source/chart/XMLSymbolImageContext.hxx | 64 + .../source/chart/XMLTextOrientationHdl.hxx | 51 + bf_xmloff/source/chart/contexts.hxx | 96 + bf_xmloff/source/chart/makefile.mk | 59 + bf_xmloff/source/chart/transporttypes.hxx | 112 + .../source/chart/xmloff_PropertyMaps.cxx | 515 ++ .../chart/xmloff_SchXMLAutoStylePoolP.cxx | 90 + .../chart/xmloff_SchXMLChartContext.cxx | 935 +++ .../source/chart/xmloff_SchXMLExport.cxx | 2493 ++++++++ .../source/chart/xmloff_SchXMLImport.cxx | 556 ++ .../chart/xmloff_SchXMLParagraphContext.cxx | 80 + .../chart/xmloff_SchXMLPlotAreaContext.cxx | 1477 +++++ .../chart/xmloff_SchXMLTableContext.cxx | 469 ++ .../chart/xmloff_XMLChartPropertyContext.cxx | 79 + .../chart/xmloff_XMLChartStyleContext.cxx | 123 + .../xmloff_XMLErrorIndicatorPropertyHdl.cxx | 108 + .../chart/xmloff_XMLSymbolImageContext.cxx | 151 + .../chart/xmloff_XMLTextOrientationHdl.cxx | 82 + bf_xmloff/source/chart/xmloff_contexts.cxx | 150 + bf_xmloff/source/core/makefile.mk | 79 + bf_xmloff/source/core/xmlenums.hxx | 60 + .../core/xmloff_DocumentSettingsContext.cxx | 888 +++ .../source/core/xmloff_ProgressBarHelper.cxx | 129 + .../source/core/xmloff_PropertySetMerger.cxx | 268 + .../core/xmloff_SettingsExportHelper.cxx | 517 ++ .../source/core/xmloff_XMLBase64Export.cxx | 101 + .../core/xmloff_XMLBase64ImportContext.cxx | 95 + .../core/xmloff_XMLBasicExportFilter.cxx | 135 + .../xmloff_XMLEmbeddedObjectExportFilter.cxx | 180 + .../xmloff_XMLEmbeddedObjectImportContext.cxx | 328 + bf_xmloff/source/core/xmloff_attrlist.cxx | 241 + bf_xmloff/source/core/xmloff_facreg.cxx | 540 ++ bf_xmloff/source/core/xmloff_i18nmap.cxx | 131 + bf_xmloff/source/core/xmloff_nmspmap.cxx | 380 ++ bf_xmloff/source/core/xmloff_unoatrcn.cxx | 305 + bf_xmloff/source/core/xmloff_xmlcnitm.cxx | 221 + bf_xmloff/source/core/xmloff_xmlehelp.cxx | 456 ++ bf_xmloff/source/core/xmloff_xmlerror.cxx | 247 + bf_xmloff/source/core/xmloff_xmlexp.cxx | 1724 ++++++ bf_xmloff/source/core/xmloff_xmlictxt.cxx | 75 + bf_xmloff/source/core/xmloff_xmlimp.cxx | 1304 ++++ bf_xmloff/source/core/xmloff_xmlkywd.cxx | 40 + bf_xmloff/source/core/xmloff_xmltkmap.cxx | 128 + bf_xmloff/source/core/xmloff_xmltoken.cxx | 2166 +++++++ bf_xmloff/source/core/xmloff_xmluconv.cxx | 1804 ++++++ .../source/draw/XMLNumberStylesExport.hxx | 58 + bf_xmloff/source/draw/eventimp.hxx | 62 + bf_xmloff/source/draw/layerexp.hxx | 44 + bf_xmloff/source/draw/layerimp.hxx | 63 + bf_xmloff/source/draw/makefile.mk | 76 + bf_xmloff/source/draw/numithdl.hxx | 58 + bf_xmloff/source/draw/propimp0.hxx | 65 + bf_xmloff/source/draw/sdpropls.hxx | 277 + bf_xmloff/source/draw/sdxmlexp_impl.hxx | 201 + bf_xmloff/source/draw/sdxmlimp_impl.hxx | 299 + bf_xmloff/source/draw/ximp3dobject.hxx | 182 + bf_xmloff/source/draw/ximp3dscene.hxx | 91 + bf_xmloff/source/draw/ximpbody.hxx | 86 + bf_xmloff/source/draw/ximpgrp.hxx | 81 + bf_xmloff/source/draw/ximpnote.hxx | 66 + bf_xmloff/source/draw/ximppage.hxx | 95 + bf_xmloff/source/draw/ximpshap.hxx | 551 ++ bf_xmloff/source/draw/ximpshow.hxx | 62 + bf_xmloff/source/draw/ximpstyl.hxx | 288 + .../draw/xmloff_XMLGraphicsDefaultStyle.cxx | 101 + .../source/draw/xmloff_XMLImageMapContext.cxx | 705 +++ .../source/draw/xmloff_XMLImageMapExport.cxx | 367 ++ .../source/draw/xmloff_XMLNumberStyles.cxx | 647 ++ .../xmloff_XMLShapePropertySetContext.cxx | 116 + .../draw/xmloff_XMLShapeStyleContext.cxx | 205 + bf_xmloff/source/draw/xmloff_animexp.cxx | 552 ++ bf_xmloff/source/draw/xmloff_animimp.cxx | 710 +++ bf_xmloff/source/draw/xmloff_eventimp.cxx | 481 ++ bf_xmloff/source/draw/xmloff_layerexp.cxx | 95 + bf_xmloff/source/draw/xmloff_layerimp.cxx | 133 + bf_xmloff/source/draw/xmloff_numithdl.cxx | 66 + bf_xmloff/source/draw/xmloff_propimp0.cxx | 223 + bf_xmloff/source/draw/xmloff_sdpropls.cxx | 1375 +++++ bf_xmloff/source/draw/xmloff_sdxmlexp.cxx | 2555 ++++++++ bf_xmloff/source/draw/xmloff_sdxmlimp.cxx | 980 +++ bf_xmloff/source/draw/xmloff_shapeexport.cxx | 1055 ++++ bf_xmloff/source/draw/xmloff_shapeexport2.cxx | 1568 +++++ bf_xmloff/source/draw/xmloff_shapeexport3.cxx | 493 ++ bf_xmloff/source/draw/xmloff_shapeimport.cxx | 1078 ++++ bf_xmloff/source/draw/xmloff_xexptran.cxx | 2945 +++++++++ bf_xmloff/source/draw/xmloff_ximp3dobject.cxx | 531 ++ bf_xmloff/source/draw/xmloff_ximp3dscene.cxx | 496 ++ bf_xmloff/source/draw/xmloff_ximpbody.cxx | 391 ++ bf_xmloff/source/draw/xmloff_ximpgrp.cxx | 129 + bf_xmloff/source/draw/xmloff_ximpnote.cxx | 122 + bf_xmloff/source/draw/xmloff_ximppage.cxx | 257 + bf_xmloff/source/draw/xmloff_ximpshap.cxx | 2747 +++++++++ bf_xmloff/source/draw/xmloff_ximpshow.cxx | 285 + bf_xmloff/source/draw/xmloff_ximpstyl.cxx | 1472 +++++ bf_xmloff/source/forms/attriblistmerge.hxx | 88 + bf_xmloff/source/forms/callbacks.hxx | 167 + bf_xmloff/source/forms/controlelement.hxx | 96 + bf_xmloff/source/forms/controlpropertyhdl.hxx | 100 + bf_xmloff/source/forms/controlpropertymap.hxx | 72 + bf_xmloff/source/forms/elementexport.hxx | 290 + bf_xmloff/source/forms/elementimport.hxx | 658 ++ bf_xmloff/source/forms/elementimport_impl.hxx | 126 + bf_xmloff/source/forms/eventexport.hxx | 88 + bf_xmloff/source/forms/eventimport.hxx | 97 + bf_xmloff/source/forms/formattributes.hxx | 345 ++ bf_xmloff/source/forms/formcellbinding.hxx | 305 + bf_xmloff/source/forms/formenums.hxx | 79 + bf_xmloff/source/forms/formevents.hxx | 51 + bf_xmloff/source/forms/formstyles.hxx | 76 + bf_xmloff/source/forms/ifacecompare.hxx | 74 + bf_xmloff/source/forms/layerexport.hxx | 297 + bf_xmloff/source/forms/layerimport.hxx | 217 + bf_xmloff/source/forms/logging.hxx | 79 + bf_xmloff/source/forms/makefile.mk | 69 + bf_xmloff/source/forms/officeforms.hxx | 109 + bf_xmloff/source/forms/propertyexport.hxx | 390 ++ bf_xmloff/source/forms/propertyimport.hxx | 236 + bf_xmloff/source/forms/strings.hxx | 264 + bf_xmloff/source/forms/valueproperties.hxx | 88 + .../source/forms/xmloff_attriblistmerge.cxx | 174 + .../source/forms/xmloff_controlelement.cxx | 73 + .../forms/xmloff_controlpropertyhdl.cxx | 329 + .../forms/xmloff_controlpropertymap.cxx | 149 + .../source/forms/xmloff_elementexport.cxx | 1662 +++++ .../source/forms/xmloff_elementimport.cxx | 1452 +++++ bf_xmloff/source/forms/xmloff_eventexport.cxx | 158 + bf_xmloff/source/forms/xmloff_eventimport.cxx | 159 + .../source/forms/xmloff_formattributes.cxx | 324 + .../source/forms/xmloff_formcellbinding.cxx | 484 ++ bf_xmloff/source/forms/xmloff_formenums.cxx | 277 + bf_xmloff/source/forms/xmloff_formevents.cxx | 86 + .../source/forms/xmloff_formlayerexport.cxx | 146 + .../source/forms/xmloff_formlayerimport.cxx | 134 + bf_xmloff/source/forms/xmloff_formstyles.cxx | 68 + bf_xmloff/source/forms/xmloff_layerexport.cxx | 714 +++ bf_xmloff/source/forms/xmloff_layerimport.cxx | 597 ++ bf_xmloff/source/forms/xmloff_logging.cxx | 63 + bf_xmloff/source/forms/xmloff_officeforms.cxx | 196 + .../source/forms/xmloff_propertyexport.cxx | 737 +++ .../source/forms/xmloff_propertyimport.cxx | 501 ++ bf_xmloff/source/forms/xmloff_strings.cxx | 39 + .../source/forms/xmloff_valueproperties.cxx | 178 + bf_xmloff/source/meta/makefile.mk | 51 + .../meta/xmloff_MetaExportComponent.cxx | 113 + .../meta/xmloff_MetaImportComponent.cxx | 161 + bf_xmloff/source/meta/xmloff_xmlmetae.cxx | 485 ++ bf_xmloff/source/meta/xmloff_xmlmetai.cxx | 800 +++ bf_xmloff/source/script/makefile.mk | 55 + bf_xmloff/source/script/xmlbasici.hxx | 100 + .../source/script/xmloff_XMLEventExport.cxx | 310 + .../script/xmloff_XMLEventImportHelper.cxx | 170 + .../script/xmloff_XMLEventsImportContext.cxx | 240 + .../script/xmloff_XMLScriptContextFactory.cxx | 109 + .../script/xmloff_XMLScriptExportHandler.cxx | 82 + .../xmloff_XMLStarBasicContextFactory.cxx | 128 + .../xmloff_XMLStarBasicExportHandler.cxx | 95 + bf_xmloff/source/script/xmloff_xmlbasici.cxx | 208 + bf_xmloff/source/script/xmloff_xmlscripti.cxx | 344 ++ bf_xmloff/source/style/DrawAspectHdl.hxx | 50 + bf_xmloff/source/style/FillStyleContext.hxx | 174 + .../source/style/PageHeaderFooterContext.hxx | 67 + .../style/PageMasterExportPropMapper.hxx | 83 + .../style/PageMasterImportPropMapper.hxx | 67 + bf_xmloff/source/style/PageMasterPropHdl.hxx | 186 + .../source/style/PageMasterPropHdlFactory.hxx | 51 + .../source/style/PageMasterPropMapper.hxx | 51 + .../source/style/PagePropertySetContext.hxx | 70 + .../style/XMLFootnoteSeparatorExport.hxx | 65 + .../style/XMLFootnoteSeparatorImport.hxx | 84 + bf_xmloff/source/style/adjushdl.hxx | 62 + bf_xmloff/source/style/backhdl.hxx | 59 + bf_xmloff/source/style/bordrhdl.hxx | 59 + bf_xmloff/source/style/breakhdl.hxx | 62 + bf_xmloff/source/style/cdouthdl.hxx | 50 + bf_xmloff/source/style/chrhghdl.hxx | 68 + bf_xmloff/source/style/chrlohdl.hxx | 63 + bf_xmloff/source/style/csmaphdl.hxx | 59 + bf_xmloff/source/style/durationhdl.hxx | 50 + bf_xmloff/source/style/escphdl.hxx | 59 + bf_xmloff/source/style/fonthdl.hxx | 87 + bf_xmloff/source/style/impastpl.hxx | 211 + bf_xmloff/source/style/kernihdl.hxx | 50 + bf_xmloff/source/style/lspachdl.hxx | 68 + bf_xmloff/source/style/makefile.mk | 128 + bf_xmloff/source/style/opaquhdl.hxx | 50 + bf_xmloff/source/style/postuhdl.hxx | 50 + bf_xmloff/source/style/shadwhdl.hxx | 50 + bf_xmloff/source/style/shdwdhdl.hxx | 50 + bf_xmloff/source/style/splithdl.hxx | 50 + bf_xmloff/source/style/tabsthdl.hxx | 53 + bf_xmloff/source/style/undlihdl.hxx | 50 + bf_xmloff/source/style/weighhdl.hxx | 51 + bf_xmloff/source/style/xmlbahdl.hxx | 249 + .../xmloff_AttributeContainerHandler.cxx | 105 + bf_xmloff/source/style/xmloff_DashStyle.cxx | 310 + .../source/style/xmloff_DrawAspectHdl.cxx | 122 + .../source/style/xmloff_EnumPropertyHdl.cxx | 115 + .../source/style/xmloff_FillStyleContext.cxx | 366 ++ .../source/style/xmloff_GradientStyle.cxx | 329 + bf_xmloff/source/style/xmloff_HatchStyle.cxx | 241 + bf_xmloff/source/style/xmloff_ImageStyle.cxx | 207 + bf_xmloff/source/style/xmloff_MarkerStyle.cxx | 275 + .../style/xmloff_MultiPropertySetHelper.cxx | 200 + .../style/xmloff_NamedBoolPropertyHdl.cxx | 85 + .../style/xmloff_PageHeaderFooterContext.cxx | 99 + .../xmloff_PageMasterExportPropMapper.cxx | 416 ++ .../style/xmloff_PageMasterImportContext.cxx | 178 + .../xmloff_PageMasterImportPropMapper.cxx | 336 + .../source/style/xmloff_PageMasterPropHdl.cxx | 428 ++ .../style/xmloff_PageMasterPropHdlFactory.cxx | 148 + .../style/xmloff_PageMasterPropMapper.cxx | 61 + .../style/xmloff_PageMasterStyleMap.cxx | 179 + .../style/xmloff_PagePropertySetContext.cxx | 145 + .../xmloff_SinglePropertySetInfoCache.cxx | 66 + .../style/xmloff_TransGradientStyle.cxx | 315 + .../xmloff_XMLBackgroundImageContext.cxx | 415 ++ .../style/xmloff_XMLBackgroundImageExport.cxx | 175 + ...ff_XMLBitmapLogicalSizePropertyHandler.cxx | 68 + ...f_XMLBitmapRepeatOffsetPropertyHandler.cxx | 108 + .../style/xmloff_XMLClipPropertyHandler.cxx | 138 + .../xmloff_XMLConstantsPropertyHandler.cxx | 115 + .../xmloff_XMLElementPropertyContext.cxx | 63 + ...mloff_XMLFillBitmapSizePropertyHandler.cxx | 102 + .../style/xmloff_XMLFontAutoStylePool.cxx | 289 + .../style/xmloff_XMLFontStylesContext.cxx | 279 + .../xmloff_XMLFootnoteSeparatorExport.cxx | 167 + .../xmloff_XMLFootnoteSeparatorImport.cxx | 193 + .../xmloff_XMLIsPercentagePropertyHandler.cxx | 65 + .../source/style/xmloff_XMLPageExport.cxx | 233 + ...off_XMLPercentOrMeasurePropertyHandler.cxx | 101 + .../xmloff_XMLRectangleMembersHandler.cxx | 133 + bf_xmloff/source/style/xmloff_adjushdl.cxx | 142 + bf_xmloff/source/style/xmloff_backhdl.cxx | 304 + bf_xmloff/source/style/xmloff_bordrhdl.cxx | 458 ++ bf_xmloff/source/style/xmloff_breakhdl.cxx | 182 + bf_xmloff/source/style/xmloff_cdouthdl.cxx | 93 + bf_xmloff/source/style/xmloff_chrhghdl.cxx | 171 + bf_xmloff/source/style/xmloff_chrlohdl.cxx | 147 + bf_xmloff/source/style/xmloff_csmaphdl.cxx | 142 + bf_xmloff/source/style/xmloff_durationhdl.cxx | 85 + bf_xmloff/source/style/xmloff_escphdl.cxx | 171 + bf_xmloff/source/style/xmloff_fonthdl.cxx | 321 + bf_xmloff/source/style/xmloff_impastp1.cxx | 124 + bf_xmloff/source/style/xmloff_impastp2.cxx | 66 + bf_xmloff/source/style/xmloff_impastp3.cxx | 156 + bf_xmloff/source/style/xmloff_impastp4.cxx | 356 ++ bf_xmloff/source/style/xmloff_kernihdl.cxx | 92 + bf_xmloff/source/style/xmloff_lspachdl.cxx | 199 + bf_xmloff/source/style/xmloff_numehelp.cxx | 559 ++ bf_xmloff/source/style/xmloff_opaquhdl.cxx | 84 + bf_xmloff/source/style/xmloff_postuhdl.cxx | 100 + bf_xmloff/source/style/xmloff_prhdlfac.cxx | 392 ++ bf_xmloff/source/style/xmloff_prstylei.cxx | 327 + bf_xmloff/source/style/xmloff_shadwhdl.cxx | 178 + bf_xmloff/source/style/xmloff_shdwdhdl.cxx | 87 + bf_xmloff/source/style/xmloff_splithdl.cxx | 83 + bf_xmloff/source/style/xmloff_styleexp.cxx | 386 ++ bf_xmloff/source/style/xmloff_tabsthdl.cxx | 97 + bf_xmloff/source/style/xmloff_undlihdl.cxx | 108 + bf_xmloff/source/style/xmloff_uniref.cxx | 43 + bf_xmloff/source/style/xmloff_weighhdl.cxx | 182 + bf_xmloff/source/style/xmloff_xmlaustp.cxx | 365 ++ bf_xmloff/source/style/xmloff_xmlbahdl.cxx | 710 +++ bf_xmloff/source/style/xmloff_xmlexppr.cxx | 917 +++ bf_xmloff/source/style/xmloff_xmlimppr.cxx | 584 ++ bf_xmloff/source/style/xmloff_xmlnume.cxx | 684 +++ bf_xmloff/source/style/xmloff_xmlnumfe.cxx | 1773 ++++++ bf_xmloff/source/style/xmloff_xmlnumfi.cxx | 2206 +++++++ bf_xmloff/source/style/xmloff_xmlnumi.cxx | 1166 ++++ bf_xmloff/source/style/xmloff_xmlprcon.cxx | 102 + bf_xmloff/source/style/xmloff_xmlprhdl.cxx | 45 + bf_xmloff/source/style/xmloff_xmlprmap.cxx | 233 + bf_xmloff/source/style/xmloff_xmlstyle.cxx | 1000 +++ bf_xmloff/source/style/xmloff_xmltabe.cxx | 138 + bf_xmloff/source/style/xmloff_xmltabi.cxx | 279 + .../source/text/XMLAnchorTypePropHdl.hxx | 59 + .../source/text/XMLAutoMarkFileContext.hxx | 69 + .../text/XMLCalculationSettingsContext.hxx | 54 + .../text/XMLChangeElementImportContext.hxx | 92 + .../source/text/XMLChangeImportContext.hxx | 91 + .../source/text/XMLChangeInfoContext.hxx | 95 + .../text/XMLChangedRegionImportContext.hxx | 104 + .../text/XMLFootnoteBodyImportContext.hxx | 74 + .../source/text/XMLFootnoteImportContext.hxx | 104 + .../XMLIndexAlphabeticalSourceContext.hxx | 110 + .../text/XMLIndexBibliographyEntryContext.hxx | 92 + .../XMLIndexBibliographySourceContext.hxx | 82 + bf_xmloff/source/text/XMLIndexBodyContext.hxx | 85 + .../text/XMLIndexChapterInfoEntryContext.hxx | 85 + .../XMLIndexIllustrationSourceContext.hxx | 78 + bf_xmloff/source/text/XMLIndexMarkExport.hxx | 121 + .../text/XMLIndexObjectSourceContext.hxx | 93 + .../text/XMLIndexSimpleEntryContext.hxx | 101 + .../source/text/XMLIndexSourceBaseContext.hxx | 138 + .../source/text/XMLIndexSpanEntryContext.hxx | 81 + bf_xmloff/source/text/XMLIndexTOCContext.hxx | 115 + .../source/text/XMLIndexTOCSourceContext.hxx | 92 + .../source/text/XMLIndexTOCStylesContext.hxx | 103 + .../text/XMLIndexTabStopEntryContext.hxx | 87 + .../text/XMLIndexTableSourceContext.hxx | 92 + .../source/text/XMLIndexTemplateContext.hxx | 165 + .../text/XMLIndexTitleTemplateContext.hxx | 98 + .../source/text/XMLIndexUserSourceContext.hxx | 99 + .../source/text/XMLLineNumberingExport.hxx | 65 + ...XMLLineNumberingSeparatorImportContext.hxx | 80 + .../source/text/XMLPropertyBackpatcher.hxx | 147 + bf_xmloff/source/text/XMLRedlineExport.hxx | 216 + bf_xmloff/source/text/XMLSectionExport.hxx | 370 ++ .../text/XMLSectionFootnoteConfigExport.hxx | 64 + .../text/XMLSectionFootnoteConfigImport.hxx | 84 + .../source/text/XMLSectionImportContext.hxx | 124 + .../text/XMLSectionSourceDDEImportContext.hxx | 84 + .../text/XMLSectionSourceImportContext.hxx | 79 + .../XMLTextCharStyleNamesElementExport.hxx | 60 + bf_xmloff/source/text/XMLTextFrameContext.hxx | 177 + .../text/XMLTextFrameHyperlinkContext.hxx | 83 + .../source/text/XMLTextListBlockContext.hxx | 90 + .../source/text/XMLTextListItemContext.hxx | 73 + .../source/text/XMLTextMarkImportContext.hxx | 99 + bf_xmloff/source/text/XMLTextNumRuleInfo.hxx | 125 + .../source/text/XMLTextPropertySetContext.hxx | 67 + .../source/text/XMLTextShapeImportHelper.hxx | 60 + .../text/XMLTrackedChangesImportContext.hxx | 81 + bf_xmloff/source/text/makefile.mk | 124 + bf_xmloff/source/text/txtdrope.hxx | 56 + bf_xmloff/source/text/txtdropi.hxx | 71 + bf_xmloff/source/text/txtexppr.hxx | 101 + bf_xmloff/source/text/txtimppr.hxx | 85 + bf_xmloff/source/text/txtparai.hxx | 84 + bf_xmloff/source/text/txtprhdl.hxx | 53 + .../text/xmloff_XMLAutoMarkFileContext.cxx | 101 + .../xmloff_XMLCalculationSettingsContext.cxx | 94 + .../xmloff_XMLChangeElementImportContext.cxx | 121 + .../text/xmloff_XMLChangeImportContext.cxx | 107 + .../text/xmloff_XMLChangeInfoContext.cxx | 132 + .../xmloff_XMLChangedRegionImportContext.cxx | 197 + .../xmloff_XMLFootnoteBodyImportContext.cxx | 76 + ..._XMLFootnoteConfigurationImportContext.cxx | 437 ++ .../text/xmloff_XMLFootnoteImportContext.cxx | 243 + ...loff_XMLIndexAlphabeticalSourceContext.cxx | 274 + ...LIndexBibliographyConfigurationContext.cxx | 305 + ...mloff_XMLIndexBibliographyEntryContext.cxx | 189 + ...loff_XMLIndexBibliographySourceContext.cxx | 115 + .../text/xmloff_XMLIndexBodyContext.cxx | 80 + ...xmloff_XMLIndexChapterInfoEntryContext.cxx | 152 + ...loff_XMLIndexIllustrationSourceContext.cxx | 96 + .../source/text/xmloff_XMLIndexMarkExport.cxx | 275 + .../xmloff_XMLIndexObjectSourceContext.cxx | 195 + .../xmloff_XMLIndexSimpleEntryContext.cxx | 133 + .../text/xmloff_XMLIndexSourceBaseContext.cxx | 272 + .../text/xmloff_XMLIndexSpanEntryContext.cxx | 81 + .../source/text/xmloff_XMLIndexTOCContext.cxx | 370 ++ .../text/xmloff_XMLIndexTOCSourceContext.cxx | 206 + .../text/xmloff_XMLIndexTOCStylesContext.cxx | 168 + .../xmloff_XMLIndexTabStopEntryContext.cxx | 168 + .../xmloff_XMLIndexTableSourceContext.cxx | 191 + .../text/xmloff_XMLIndexTemplateContext.cxx | 505 ++ .../xmloff_XMLIndexTitleTemplateContext.cxx | 118 + .../text/xmloff_XMLIndexUserSourceContext.cxx | 236 + .../text/xmloff_XMLLineNumberingExport.cxx | 220 + .../xmloff_XMLLineNumberingImportContext.cxx | 336 + ...XMLLineNumberingSeparatorImportContext.cxx | 105 + .../text/xmloff_XMLPropertyBackpatcher.cxx | 253 + .../source/text/xmloff_XMLRedlineExport.cxx | 685 +++ .../source/text/xmloff_XMLSectionExport.cxx | 1789 ++++++ .../xmloff_XMLSectionFootnoteConfigExport.cxx | 201 + .../xmloff_XMLSectionFootnoteConfigImport.cxx | 192 + .../text/xmloff_XMLSectionImportContext.cxx | 396 ++ ...mloff_XMLSectionSourceDDEImportContext.cxx | 195 + .../xmloff_XMLSectionSourceImportContext.cxx | 164 + .../xmloff_XMLStringBufferImportContext.cxx | 88 + ...off_XMLTextCharStyleNamesElementExport.cxx | 90 + .../text/xmloff_XMLTextColumnsContext.cxx | 499 ++ .../text/xmloff_XMLTextColumnsExport.cxx | 188 + .../text/xmloff_XMLTextFrameContext.cxx | 1174 ++++ .../xmloff_XMLTextFrameHyperlinkContext.cxx | 172 + .../xmloff_XMLTextHeaderFooterContext.cxx | 187 + .../text/xmloff_XMLTextListAutoStylePool.cxx | 307 + .../text/xmloff_XMLTextListBlockContext.cxx | 239 + .../text/xmloff_XMLTextListItemContext.cxx | 137 + .../text/xmloff_XMLTextMarkImportContext.cxx | 244 + .../text/xmloff_XMLTextMasterPageContext.cxx | 272 + .../text/xmloff_XMLTextMasterPageExport.cxx | 188 + .../xmloff_XMLTextMasterStylesContext.cxx | 97 + .../source/text/xmloff_XMLTextNumRuleInfo.cxx | 147 + .../text/xmloff_XMLTextPropertySetContext.cxx | 159 + .../text/xmloff_XMLTextShapeImportHelper.cxx | 164 + .../text/xmloff_XMLTextShapeStyleContext.cxx | 237 + .../text/xmloff_XMLTextTableContext.cxx | 51 + .../xmloff_XMLTrackedChangesImportContext.cxx | 127 + bf_xmloff/source/text/xmloff_txtdrope.cxx | 111 + bf_xmloff/source/text/xmloff_txtdropi.cxx | 154 + bf_xmloff/source/text/xmloff_txtexppr.cxx | 837 +++ bf_xmloff/source/text/xmloff_txtflde.cxx | 3349 ++++++++++ bf_xmloff/source/text/xmloff_txtfldi.cxx | 3949 ++++++++++++ bf_xmloff/source/text/xmloff_txtftne.cxx | 379 ++ bf_xmloff/source/text/xmloff_txtimp.cxx | 1965 ++++++ bf_xmloff/source/text/xmloff_txtimppr.cxx | 681 +++ bf_xmloff/source/text/xmloff_txtparae.cxx | 2997 +++++++++ bf_xmloff/source/text/xmloff_txtparai.cxx | 1975 ++++++ bf_xmloff/source/text/xmloff_txtprhdl.cxx | 1381 +++++ bf_xmloff/source/text/xmloff_txtprmap.cxx | 768 +++ bf_xmloff/source/text/xmloff_txtsecte.cxx | 226 + bf_xmloff/source/text/xmloff_txtstyle.cxx | 156 + bf_xmloff/source/text/xmloff_txtstyli.cxx | 400 ++ bf_xmloff/source/text/xmloff_txtvfldi.cxx | 1416 +++++ bf_xmloff/util/bf_xo.component | 121 + bf_xmloff/util/bf_xo.flt | 20 + bf_xmloff/util/exports.dxp | 1 + bf_xmloff/util/makefile.mk | 112 + binfilterdetect/source/bindet.component | 34 + binfilterdetect/source/bindetect.cxx | 439 ++ binfilterdetect/source/bindetect.hxx | 85 + binfilterdetect/source/makefile.mk | 78 + .../source/bf_migrate/bf_migrateexports.cxx | 102 + .../bf_migrate/bf_migratefilter.component | 37 + filter/source/bf_migrate/bf_migratefilter.cxx | 544 ++ filter/source/bf_migrate/bf_migratefilter.hxx | 121 + filter/source/bf_migrate/exports.dxp | 1 + filter/source/bf_migrate/makefile.mk | 82 + filter/source/bf_offwrp/bf_wrapper.component | 34 + filter/source/bf_offwrp/bf_wrapper.cxx | 263 + filter/source/bf_offwrp/bf_wrapper.hxx | 101 + filter/source/bf_offwrp/exports.dxp | 1 + filter/source/bf_offwrp/makefile.mk | 87 + inc/bf_basic/basmgr.hxx | 233 + inc/bf_basic/basrdll.hxx | 65 + inc/bf_basic/sb.hxx | 41 + inc/bf_basic/sbdef.hxx | 114 + inc/bf_basic/sberrors.hxx | 550 ++ inc/bf_basic/sbmeth.hxx | 107 + inc/bf_basic/sbmod.hxx | 160 + inc/bf_basic/sbprop.hxx | 90 + inc/bf_basic/sbstar.hxx | 170 + inc/bf_basic/sbx.hxx | 371 ++ inc/bf_basic/sbxbase.hxx | 61 + inc/bf_basic/sbxcore.hxx | 192 + inc/bf_basic/sbxdef.hxx | 388 ++ inc/bf_basic/sbxfac.hxx | 59 + inc/bf_basic/sbxmeth.hxx | 69 + inc/bf_basic/sbxobj.hxx | 126 + inc/bf_basic/sbxprop.hxx | 68 + inc/bf_basic/sbxvar.hxx | 508 ++ inc/bf_goodies/b3dcolor.hxx | 81 + inc/bf_goodies/b3dcompo.hxx | 329 + inc/bf_goodies/b3dentty.hxx | 136 + inc/bf_goodies/b3dgeom.hxx | 241 + inc/bf_goodies/b3dlight.hxx | 221 + inc/bf_goodies/b3dtex.hxx | 145 + inc/bf_goodies/b3dtrans.hxx | 298 + inc/bf_goodies/b3dvolum.hxx | 89 + inc/bf_goodies/base3d.hxx | 144 + inc/bf_goodies/bucket.hxx | 192 + inc/bf_goodies/graphicobject.hxx | 95 + inc/bf_goodies/hmatrix.hxx | 165 + inc/bf_goodies/matril3d.hxx | 100 + inc/bf_goodies/matrix3d.hxx | 124 + inc/bf_goodies/point3d.hxx | 103 + inc/bf_goodies/point4d.hxx | 115 + inc/bf_goodies/vector3d.hxx | 116 + inc/bf_offmgr/app.hxx | 70 + inc/bf_offmgr/ofaids.hrc | 97 + inc/bf_sc/ViewSettingsSequenceDefines.hxx | 105 + inc/bf_sc/addincol.hxx | 169 + inc/bf_sc/afmtuno.hxx | 311 + inc/bf_sc/appluno.hxx | 217 + inc/bf_sc/appoptio.hxx | 153 + inc/bf_sc/arealink.hxx | 91 + inc/bf_sc/attarray.hxx | 207 + inc/bf_sc/attrib.hxx | 333 + inc/bf_sc/autoform.hxx | 268 + inc/bf_sc/bclist.hxx | 63 + inc/bf_sc/bf_sc.hrc | 1340 ++++ inc/bf_sc/bigrange.hxx | 277 + inc/bf_sc/brdcst.hxx | 72 + inc/bf_sc/callform.hxx | 119 + inc/bf_sc/cell.hxx | 566 ++ inc/bf_sc/cellform.hxx | 68 + inc/bf_sc/cellsuno.hxx | 1470 +++++ inc/bf_sc/cfgids.hxx | 46 + inc/bf_sc/chartarr.hxx | 202 + inc/bf_sc/chartlis.hxx | 124 + inc/bf_sc/chartuno.hxx | 175 + inc/bf_sc/chgtrack.hxx | 1221 ++++ inc/bf_sc/chgviset.hxx | 149 + inc/bf_sc/collect.hxx | 181 + inc/bf_sc/column.hxx | 351 ++ inc/bf_sc/compiler.hrc | 373 ++ inc/bf_sc/compiler.hxx | 565 ++ inc/bf_sc/conditio.hxx | 272 + inc/bf_sc/confuno.hxx | 113 + inc/bf_sc/consoli.hxx | 136 + inc/bf_sc/convuno.hxx | 180 + inc/bf_sc/cursuno.hxx | 113 + inc/bf_sc/dapiuno.hxx | 435 ++ inc/bf_sc/datauno.hxx | 641 ++ inc/bf_sc/dbcolect.hxx | 239 + inc/bf_sc/dbdocutl.hxx | 56 + inc/bf_sc/dbtoken.hxx | 60 + inc/bf_sc/defltuno.hxx | 134 + inc/bf_sc/detdata.hxx | 113 + inc/bf_sc/detfunc.hxx | 157 + inc/bf_sc/dispuno.hxx | 157 + inc/bf_sc/dociter.hxx | 320 + inc/bf_sc/docoptio.hxx | 206 + inc/bf_sc/docpool.hxx | 76 + inc/bf_sc/document.hxx | 1221 ++++ inc/bf_sc/docuno.hxx | 822 +++ inc/bf_sc/dpobject.hxx | 178 + inc/bf_sc/dpoutput.hxx | 116 + inc/bf_sc/dpsave.hxx | 184 + inc/bf_sc/dpsdbtab.hxx | 70 + inc/bf_sc/dpshttab.hxx | 80 + inc/bf_sc/dptabdat.hxx | 137 + inc/bf_sc/dptabres.hxx | 147 + inc/bf_sc/dptabsrc.hxx | 578 ++ inc/bf_sc/drawpage.hxx | 56 + inc/bf_sc/drdefuno.hxx | 57 + inc/bf_sc/drwlayer.hxx | 161 + inc/bf_sc/editsrc.hxx | 203 + inc/bf_sc/editutil.hxx | 233 + inc/bf_sc/eeimport.hxx | 73 + inc/bf_sc/eetext.hxx | 47 + inc/bf_sc/fielduno.hxx | 459 ++ inc/bf_sc/filter.hxx | 128 + inc/bf_sc/filtuno.hxx | 115 + inc/bf_sc/fmtuno.hxx | 307 + inc/bf_sc/forbiuno.hxx | 59 + inc/bf_sc/funcuno.hxx | 154 + inc/bf_sc/global.hxx | 1532 +++++ inc/bf_sc/globstr.hrc | 281 + inc/bf_sc/hints.hxx | 155 + inc/bf_sc/htmlimp.hxx | 58 + inc/bf_sc/indexmap.hxx | 58 + inc/bf_sc/inputopt.hxx | 109 + inc/bf_sc/linkuno.hxx | 485 ++ inc/bf_sc/markarr.hxx | 86 + inc/bf_sc/markdata.hxx | 110 + inc/bf_sc/miscuno.hxx | 300 + inc/bf_sc/mutexhlp.hxx | 50 + inc/bf_sc/nameuno.hxx | 311 + inc/bf_sc/navicfg.hxx | 57 + inc/bf_sc/notesuno.hxx | 128 + inc/bf_sc/olinetab.hxx | 168 + inc/bf_sc/opcode.hxx | 393 ++ inc/bf_sc/optuno.hxx | 83 + inc/bf_sc/optutil.hxx | 78 + inc/bf_sc/pagepar.hxx | 87 + inc/bf_sc/pageuno.hxx | 60 + inc/bf_sc/patattr.hxx | 192 + inc/bf_sc/pivot.hxx | 309 + inc/bf_sc/printopt.hxx | 82 + inc/bf_sc/prnsave.hxx | 77 + inc/bf_sc/progress.hxx | 138 + inc/bf_sc/rangelst.hxx | 245 + inc/bf_sc/rangenam.hxx | 203 + inc/bf_sc/rangeseq.hxx | 69 + inc/bf_sc/rangeutl.hxx | 118 + inc/bf_sc/rechead.hxx | 200 + inc/bf_sc/refdata.hxx | 181 + inc/bf_sc/refreshtimer.hxx | 142 + inc/bf_sc/rtfimp.hxx | 46 + inc/bf_sc/scdll.hxx | 111 + inc/bf_sc/scerrors.hxx | 61 + inc/bf_sc/scextopt.hxx | 228 + inc/bf_sc/scfuncs.hrc | 319 + inc/bf_sc/scitems.hxx | 243 + inc/bf_sc/sclnlnk.hxx | 44 + inc/bf_sc/scmod.hxx | 194 + inc/bf_sc/scresid.hxx | 48 + inc/bf_sc/scuiks.hxx | 120 + inc/bf_sc/servuno.hxx | 101 + inc/bf_sc/shapeuno.hxx | 217 + inc/bf_sc/shellids.hxx | 58 + inc/bf_sc/sortparam.hxx | 79 + inc/bf_sc/stlpool.hxx | 82 + inc/bf_sc/stlsheet.hxx | 95 + inc/bf_sc/strload.hxx | 56 + inc/bf_sc/styleuno.hxx | 366 ++ inc/bf_sc/subtotal.hxx | 97 + inc/bf_sc/table.hxx | 462 ++ inc/bf_sc/tablink.hxx | 117 + inc/bf_sc/tabopparams.hxx | 108 + inc/bf_sc/textuno.hxx | 414 ++ inc/bf_sc/token.hxx | 491 ++ inc/bf_sc/unitconv.hxx | 75 + inc/bf_sc/unonames.hxx | 494 ++ inc/bf_sc/unowids.hxx | 89 + inc/bf_sc/userdat.hxx | 99 + inc/bf_sc/userlist.hxx | 90 + inc/bf_sc/validat.hxx | 162 + inc/bf_sc/viewopti.hxx | 182 + inc/bf_sc/viewuno.hxx | 336 + inc/bf_sc/zforauto.hxx | 59 + inc/bf_sch/ChXChartAxis.hxx | 127 + inc/bf_sch/ChXChartDocument.hxx | 274 + inc/bf_sch/ReBuildHint.hxx | 47 + inc/bf_sch/SchAddInCollection.hxx | 60 + inc/bf_sch/adjust.hxx | 53 + inc/bf_sch/app.hrc | 151 + inc/bf_sch/app.hxx | 76 + inc/bf_sch/axisid.hxx | 81 + inc/bf_sch/axisobj.hxx | 63 + inc/bf_sch/calculat.hxx | 136 + inc/bf_sch/cellranges.hxx | 87 + inc/bf_sch/chartbar.hxx | 130 + inc/bf_sch/charttyp.hxx | 122 + inc/bf_sch/chattr.hxx | 149 + inc/bf_sch/chaxis.hxx | 389 ++ inc/bf_sch/chdescr.hxx | 113 + inc/bf_sch/chmod3d.hxx | 139 + inc/bf_sch/chtmodel.hxx | 1223 ++++ inc/bf_sch/chtscene.hxx | 79 + inc/bf_sch/chwindow.hxx | 117 + inc/bf_sch/datapoin.hxx | 76 + inc/bf_sch/datarow.hxx | 72 + inc/bf_sch/defines.hxx | 129 + inc/bf_sch/docshell.hxx | 159 + inc/bf_sch/eetext.hxx | 79 + inc/bf_sch/glob.hrc | 57 + inc/bf_sch/glob.hxx | 68 + inc/bf_sch/globfunc.hxx | 237 + inc/bf_sch/itempool.hxx | 58 + inc/bf_sch/mapprov.hxx | 76 + inc/bf_sch/memchrt.hxx | 860 +++ inc/bf_sch/modeldata.hxx | 251 + inc/bf_sch/objadj.hxx | 78 + inc/bf_sch/objfac.hxx | 65 + inc/bf_sch/objid.hxx | 76 + inc/bf_sch/pairs.hxx | 177 + inc/bf_sch/schattr.hxx | 198 + inc/bf_sch/schdll.hxx | 105 + inc/bf_sch/schdll0.hxx | 82 + inc/bf_sch/schgroup.hxx | 101 + inc/bf_sch/schiocmp.hxx | 58 + inc/bf_sch/schmod.hxx | 114 + inc/bf_sch/schopt.hxx | 107 + inc/bf_sch/schresid.hxx | 46 + inc/bf_sch/schview.hxx | 111 + inc/bf_sch/stlpool.hxx | 64 + inc/bf_sch/stlsheet.hxx | 59 + inc/bf_sch/strings.hrc | 89 + inc/bf_sch/unonames.hxx | 149 + inc/bf_sd/anminfo.hxx | 108 + inc/bf_sd/cusshow.hxx | 76 + inc/bf_sd/diadef.h | 44 + inc/bf_sd/docshell.hxx | 148 + inc/bf_sd/drawdoc.hxx | 526 ++ inc/bf_sd/eetext.hxx | 74 + inc/bf_sd/fadedef.h | 46 + inc/bf_sd/frmview.hxx | 207 + inc/bf_sd/glob.hrc | 112 + inc/bf_sd/glob.hxx | 51 + inc/bf_sd/grdocsh.hxx | 76 + inc/bf_sd/helpids.h | 64 + inc/bf_sd/imapinfo.hxx | 92 + inc/bf_sd/pres.hxx | 98 + inc/bf_sd/sdattr.hxx | 334 + inc/bf_sd/sdbinfilter.hxx | 56 + inc/bf_sd/sddll.hxx | 113 + inc/bf_sd/sderror.hxx | 70 + inc/bf_sd/sdfilter.hxx | 82 + inc/bf_sd/sdiocmpt.hxx | 56 + inc/bf_sd/sdmod.hxx | 125 + inc/bf_sd/sdobjfac.hxx | 61 + inc/bf_sd/sdoutl.hxx | 48 + inc/bf_sd/sdpage.hxx | 222 + inc/bf_sd/sdresid.hxx | 48 + inc/bf_sd/sduiks.hrc | 73 + inc/bf_sd/sdxmlwrp.hxx | 62 + inc/bf_sd/stlpool.hxx | 89 + inc/bf_sd/stlsheet.hxx | 68 + inc/bf_sd/strmname.h | 53 + inc/bf_sfx2/app.hxx | 323 + inc/bf_sfx2/appuno.hxx | 102 + inc/bf_sfx2/arrdecl.hxx | 60 + inc/bf_sfx2/bitset.hxx | 248 + inc/bf_sfx2/cfgitem.hxx | 110 + inc/bf_sfx2/cntids.hrc | 424 ++ inc/bf_sfx2/docfac.hxx | 705 +++ inc/bf_sfx2/docfile.hxx | 317 + inc/bf_sfx2/docfilt.hxx | 162 + inc/bf_sfx2/docinf.hxx | 261 + inc/bf_sfx2/doctempl.hxx | 122 + inc/bf_sfx2/event.hxx | 143 + inc/bf_sfx2/evntconf.hxx | 168 + inc/bf_sfx2/fcontnr.hxx | 314 + inc/bf_sfx2/frameobj.hxx | 101 + inc/bf_sfx2/frmdescr.hxx | 297 + inc/bf_sfx2/genlink.hxx | 64 + inc/bf_sfx2/hintpost.hxx | 74 + inc/bf_sfx2/interno.hxx | 128 + inc/bf_sfx2/macrconf.hxx | 116 + inc/bf_sfx2/map.hxx | 86 + inc/bf_sfx2/minarray.hxx | 428 ++ inc/bf_sfx2/minstack.hxx | 102 + inc/bf_sfx2/misccfg.hxx | 68 + inc/bf_sfx2/module.hxx | 96 + inc/bf_sfx2/objitem.hxx | 56 + inc/bf_sfx2/objsh.hxx | 444 ++ inc/bf_sfx2/objuno.hxx | 186 + inc/bf_sfx2/plugobj.hxx | 95 + inc/bf_sfx2/printer.hxx | 120 + inc/bf_sfx2/progress.hxx | 80 + inc/bf_sfx2/request.hxx | 56 + inc/bf_sfx2/saveopt.hxx | 142 + inc/bf_sfx2/sfx.hrc | 421 ++ inc/bf_sfx2/sfxbasemodel.hxx | 469 ++ inc/bf_sfx2/sfxdefs.hxx | 44 + inc/bf_sfx2/sfxsids.hrc | 1259 ++++ inc/bf_sfx2/sfxuno.hxx | 586 ++ inc/bf_sfx2/shell.hxx | 83 + inc/bf_sfx2/srchdefs.hxx | 51 + inc/bf_sfx2/srchitem.hxx | 290 + inc/bf_sfx2/swap.hxx | 98 + inc/bf_sfx2/timestamp.hxx | 126 + inc/bf_sfx2/whranges.hxx | 67 + inc/bf_so3/applet.hxx | 119 + inc/bf_so3/binding.hxx | 65 + inc/bf_so3/client.hxx | 213 + inc/bf_so3/embobj.hxx | 235 + inc/bf_so3/factory.hxx | 116 + inc/bf_so3/iface.hxx | 320 + inc/bf_so3/inetbnd.hxx | 38 + inc/bf_so3/ipclient.hxx | 111 + inc/bf_so3/ipenv.hxx | 347 ++ inc/bf_so3/ipobj.hxx | 152 + inc/bf_so3/ipwin.hxx | 186 + inc/bf_so3/linkmgr.hxx | 129 + inc/bf_so3/linksrc.hxx | 114 + inc/bf_so3/lnkbase.hxx | 151 + inc/bf_so3/outplace.hxx | 124 + inc/bf_so3/persist.hxx | 298 + inc/bf_so3/plugin.hxx | 132 + inc/bf_so3/protocol.hxx | 107 + inc/bf_so3/pseudo.hxx | 161 + inc/bf_so3/so2defs.hxx | 41 + inc/bf_so3/so2dll.hxx | 163 + inc/bf_so3/so2ref.hxx | 46 + inc/bf_so3/so3dllapi.h | 45 + inc/bf_so3/soerr.hxx | 83 + inc/bf_so3/staticbaseurl.hxx | 92 + inc/bf_so3/svstor.hxx | 232 + inc/bf_so3/transbnd.hxx | 346 ++ inc/bf_so3/transprt.hxx | 311 + inc/bf_starmath/applicat.hxx | 87 + inc/bf_starmath/command.hxx | 63 + inc/bf_starmath/config.hxx | 64 + inc/bf_starmath/document.hxx | 210 + inc/bf_starmath/dynary.hxx | 105 + inc/bf_starmath/format.hxx | 180 + inc/bf_starmath/node.hxx | 817 +++ inc/bf_starmath/parse.hxx | 272 + inc/bf_starmath/rect.hxx | 268 + inc/bf_starmath/smdll.hxx | 74 + inc/bf_starmath/smdll0.hxx | 82 + inc/bf_starmath/smmod.hxx | 172 + inc/bf_starmath/starmath.hrc | 528 ++ inc/bf_starmath/symbol.hxx | 205 + inc/bf_starmath/types.hxx | 193 + inc/bf_starmath/unomodel.hxx | 98 + inc/bf_starmath/utility.hxx | 288 + inc/bf_svtools/DocumentInfoPreview.hxx | 66 + inc/bf_svtools/FilterConfigItem.hxx | 96 + inc/bf_svtools/PasswordHelper.hxx | 65 + inc/bf_svtools/QueryFolderName.hxx | 67 + inc/bf_svtools/addxmltostorageoptions.hxx | 143 + inc/bf_svtools/adrparse.hxx | 87 + inc/bf_svtools/aeitem.hxx | 75 + inc/bf_svtools/apearcfg.hxx | 67 + inc/bf_svtools/asynclink.hxx | 74 + inc/bf_svtools/bf_postwin.h | 260 + inc/bf_svtools/bf_prewin.h | 83 + inc/bf_svtools/bf_solar.h | 81 + inc/bf_svtools/bintitem.hxx | 90 + inc/bf_svtools/brdcst.hxx | 84 + inc/bf_svtools/broadcast.hxx | 71 + inc/bf_svtools/cacheoptions.hxx | 155 + inc/bf_svtools/cancel.hxx | 145 + inc/bf_svtools/cenumitm.hxx | 185 + inc/bf_svtools/cintitem.hxx | 289 + inc/bf_svtools/cjkoptions.hxx | 72 + inc/bf_svtools/cmdoptions.hxx | 165 + inc/bf_svtools/cnclhint.hxx | 57 + inc/bf_svtools/cntnrsrt.hxx | 155 + inc/bf_svtools/cntwall.hxx | 84 + inc/bf_svtools/cntwids.hrc | 506 ++ inc/bf_svtools/colorcfg.hxx | 119 + inc/bf_svtools/compatibility.hxx | 185 + inc/bf_svtools/controldims.hrc | 102 + inc/bf_svtools/cstitem.hxx | 98 + inc/bf_svtools/ctloptions.hxx | 92 + inc/bf_svtools/ctrltool.hxx | 108 + inc/bf_svtools/ctypeitm.hxx | 88 + inc/bf_svtools/custritm.hxx | 100 + inc/bf_svtools/dateitem.hxx | 110 + inc/bf_svtools/defaultoptions.hxx | 58 + inc/bf_svtools/docpasswdrequest.hxx | 75 + inc/bf_svtools/dtritem.hxx | 98 + inc/bf_svtools/dynamicmenuoptions.hxx | 172 + inc/bf_svtools/ehdl.hxx | 91 + inc/bf_svtools/eitem.hxx | 79 + inc/bf_svtools/expander.hxx | 101 + inc/bf_svtools/extendedsecurityoptions.hxx | 156 + inc/bf_svtools/filerec.hxx | 435 ++ inc/bf_svtools/fileview.hxx | 265 + inc/bf_svtools/filter.hxx | 387 ++ inc/bf_svtools/flagitem.hxx | 87 + inc/bf_svtools/flbytes.hxx | 121 + inc/bf_svtools/fltcall.hxx | 85 + inc/bf_svtools/fltdefs.hxx | 160 + inc/bf_svtools/fontoptions.hxx | 148 + inc/bf_svtools/frqitem.hxx | 183 + inc/bf_svtools/fstathelper.hxx | 63 + inc/bf_svtools/gifread.hxx | 150 + inc/bf_svtools/globalnameitem.hxx | 68 + inc/bf_svtools/helpid.hrc | 117 + inc/bf_svtools/helpopt.hxx | 62 + inc/bf_svtools/hint.hxx | 80 + inc/bf_svtools/historyoptions.hxx | 182 + inc/bf_svtools/htmlkywd.hxx | 847 +++ inc/bf_svtools/htmlout.hxx | 70 + inc/bf_svtools/htmltokn.h | 577 ++ inc/bf_svtools/idhelper.hxx | 143 + inc/bf_svtools/ilstitem.hxx | 72 + inc/bf_svtools/imageresourceaccess.hxx | 82 + inc/bf_svtools/imap.hxx | 134 + inc/bf_svtools/imapcirc.hxx | 89 + inc/bf_svtools/imapobj.hxx | 164 + inc/bf_svtools/imappoly.hxx | 100 + inc/bf_svtools/imaprect.hxx | 93 + inc/bf_svtools/imgdef.hxx | 60 + inc/bf_svtools/inethist.hxx | 142 + inc/bf_svtools/inetimg.hxx | 89 + inc/bf_svtools/inetoptions.hxx | 87 + inc/bf_svtools/inettype.hxx | 434 ++ inc/bf_svtools/iniadrtk.hxx | 60 + inc/bf_svtools/instrm.hxx | 84 + inc/bf_svtools/internaloptions.hxx | 158 + inc/bf_svtools/intitem.hxx | 173 + inc/bf_svtools/iodlg.hrc | 107 + inc/bf_svtools/isethint.hxx | 60 + inc/bf_svtools/itemiter.hxx | 75 + inc/bf_svtools/itempool.hxx | 278 + inc/bf_svtools/itemprop.hxx | 176 + inc/bf_svtools/itemset.hxx | 214 + inc/bf_svtools/javacontext.hxx | 94 + inc/bf_svtools/javainteractionhandler.hxx | 86 + inc/bf_svtools/jpeg.hxx | 132 + inc/bf_svtools/languageoptions.hxx | 103 + inc/bf_svtools/lckbitem.hxx | 72 + inc/bf_svtools/lingucfg.hxx | 163 + inc/bf_svtools/linguprops.hxx | 104 + inc/bf_svtools/listener.hxx | 73 + inc/bf_svtools/listeneriter.hxx | 76 + inc/bf_svtools/lngmisc.hxx | 70 + inc/bf_svtools/localisationoptions.hxx | 147 + inc/bf_svtools/localresaccess.hxx | 85 + inc/bf_svtools/loginerr.hxx | 164 + inc/bf_svtools/lstner.hxx | 85 + inc/bf_svtools/macitem.hxx | 219 + inc/bf_svtools/memberid.hrc | 44 + inc/bf_svtools/menuoptions.hxx | 148 + inc/bf_svtools/metitem.hxx | 61 + inc/bf_svtools/misccfg.hxx | 76 + inc/bf_svtools/miscopt.hxx | 164 + inc/bf_svtools/moduleoptions.hxx | 191 + inc/bf_svtools/msgrd.hxx | 44 + inc/bf_svtools/msgwr.hxx | 43 + inc/bf_svtools/nfkeytab.hxx | 126 + inc/bf_svtools/nfsymbol.hxx | 73 + inc/bf_svtools/nfversi.hxx | 70 + inc/bf_svtools/nranges.hxx | 98 + inc/bf_svtools/numuno.hxx | 101 + inc/bf_svtools/ondemand.hxx | 474 ++ inc/bf_svtools/options.hxx | 55 + inc/bf_svtools/options3d.hxx | 148 + inc/bf_svtools/optionsdlg.hxx | 53 + inc/bf_svtools/outstrm.hxx | 45 + inc/bf_svtools/ownlist.hxx | 105 + inc/bf_svtools/pathoptions.hxx | 122 + inc/bf_svtools/pngread.hxx | 172 + inc/bf_svtools/poolcach.hxx | 63 + inc/bf_svtools/poolitem.hxx | 388 ++ inc/bf_svtools/printoptions.hxx | 104 + inc/bf_svtools/printwarningoptions.hxx | 148 + inc/bf_svtools/privsplt.hxx | 91 + inc/bf_svtools/ptitem.hxx | 88 + inc/bf_svtools/rectitem.hxx | 86 + inc/bf_svtools/reqitem.hxx | 72 + inc/bf_svtools/rngitem.hxx | 122 + inc/bf_svtools/saveopt.hxx | 81 + inc/bf_svtools/searchopt.hxx | 92 + inc/bf_svtools/sectctr.hxx | 160 + inc/bf_svtools/section.hxx | 114 + inc/bf_svtools/securityoptions.hxx | 208 + inc/bf_svtools/sfontitm.hxx | 221 + inc/bf_svtools/sfxecode.hxx | 118 + inc/bf_svtools/sgfbram.hxx | 166 + inc/bf_svtools/sgffilt.hxx | 57 + inc/bf_svtools/sgvmain.hxx | 362 ++ inc/bf_svtools/sgvspln.hxx | 79 + inc/bf_svtools/slstitm.hxx | 88 + inc/bf_svtools/smplhint.hxx | 108 + inc/bf_svtools/soerr.hxx | 83 + inc/bf_svtools/solar.hrc | 305 + inc/bf_svtools/sores.hxx | 182 + inc/bf_svtools/sourceviewconfig.hxx | 59 + inc/bf_svtools/startoptions.hxx | 149 + inc/bf_svtools/stritem.hxx | 63 + inc/bf_svtools/strmadpt.hxx | 141 + inc/bf_svtools/style.hrc | 39 + inc/bf_svtools/style.hxx | 371 ++ inc/bf_svtools/stylepool.hxx | 96 + inc/bf_svtools/svarray.hxx | 945 +++ inc/bf_svtools/svdde.hxx | 441 ++ inc/bf_svtools/svicnvw.hxx | 299 + inc/bf_svtools/svimpicn.hxx | 326 + inc/bf_svtools/svipcdef.h | 74 + inc/bf_svtools/svstdarr.hxx | 150 + inc/bf_svtools/svtdata.hxx | 82 + inc/bf_svtools/svtdllapi.h | 29 + inc/bf_svtools/svtool.h | 40 + inc/bf_svtools/svtools.hrc | 285 + inc/bf_svtools/svtuno.hxx | 68 + inc/bf_svtools/syslocale.hxx | 85 + inc/bf_svtools/syslocaleoptions.hxx | 119 + inc/bf_svtools/szitem.hxx | 86 + inc/bf_svtools/templdlg.hxx | 96 + inc/bf_svtools/testtool.hxx | 83 + inc/bf_svtools/tfrmitem.hxx | 83 + inc/bf_svtools/tooltiplbox.hxx | 71 + inc/bf_svtools/tresitem.hxx | 72 + inc/bf_svtools/ttprops.hxx | 118 + inc/bf_svtools/twain.hxx | 105 + inc/bf_svtools/undo.hxx | 233 + inc/bf_svtools/undoopt.hxx | 59 + inc/bf_svtools/unoevent.hxx | 338 ++ inc/bf_svtools/unoimap.hxx | 54 + inc/bf_svtools/urihelper.hxx | 132 + inc/bf_svtools/urlbmk.hxx | 75 + inc/bf_svtools/urlfilter.hxx | 72 + inc/bf_svtools/useroptions.hxx | 104 + inc/bf_svtools/viewoptions.hxx | 208 + inc/bf_svtools/visitem.hxx | 106 + inc/bf_svtools/wallitem.hxx | 69 + inc/bf_svtools/whiter.hxx | 68 + inc/bf_svtools/whmap.hxx | 66 + inc/bf_svtools/wmf.hxx | 55 + inc/bf_svtools/workingsetoptions.hxx | 148 + inc/bf_svtools/xbmread.hxx | 103 + inc/bf_svtools/xmlcnimp.hxx | 147 + inc/bf_svtools/xmlement.hxx | 47 + inc/bf_svtools/xpmread.hxx | 139 + inc/bf_svtools/zforfind.hxx | 298 + inc/bf_svtools/zforlist.hxx | 889 +++ inc/bf_svtools/zformat.hxx | 550 ++ inc/bf_svx/AccessibleStaticTextBase.hxx | 269 + inc/bf_svx/IAccessibleParent.hxx | 99 + inc/bf_svx/IAccessibleViewForwarder.hxx | 135 + .../IAccessibleViewForwarderListener.hxx | 78 + inc/bf_svx/UnoForbiddenCharsTable.hxx | 70 + inc/bf_svx/UnoNamespaceMap.hxx | 46 + inc/bf_svx/_fmresid.hrc | 57 + inc/bf_svx/adjitem.hxx | 146 + inc/bf_svx/adritem.hxx | 117 + inc/bf_svx/akrnitem.hxx | 75 + inc/bf_svx/algitem.hxx | 181 + inc/bf_svx/asiancfg.hxx | 67 + inc/bf_svx/blnkitem.hxx | 74 + inc/bf_svx/bolnitem.hxx | 59 + inc/bf_svx/boxitem.hxx | 299 + inc/bf_svx/boxobj.hxx | 100 + inc/bf_svx/brkitem.hxx | 102 + inc/bf_svx/brshitem.hxx | 132 + inc/bf_svx/bulitem.hxx | 150 + inc/bf_svx/camera3d.hxx | 106 + inc/bf_svx/charreliefitem.hxx | 84 + inc/bf_svx/charrotateitem.hxx | 96 + inc/bf_svx/charscaleitem.hxx | 77 + inc/bf_svx/chrtitem.hxx | 327 + inc/bf_svx/clipfmtitem.hxx | 56 + inc/bf_svx/cmapitem.hxx | 88 + inc/bf_svx/cntritem.hxx | 70 + inc/bf_svx/colritem.hxx | 95 + inc/bf_svx/crsditem.hxx | 88 + inc/bf_svx/cscoitem.hxx | 74 + inc/bf_svx/cube3d.hxx | 103 + inc/bf_svx/dataaccessdescriptor.hxx | 94 + inc/bf_svx/dbaexchange.hxx | 233 + inc/bf_svx/dbexch.hrc | 56 + inc/bf_svx/def3d.hxx | 72 + inc/bf_svx/deflt3d.hxx | 160 + inc/bf_svx/dgdefs_.hxx | 344 ++ inc/bf_svx/dialdll.hxx | 45 + inc/bf_svx/dialmgr.hxx | 65 + inc/bf_svx/dialogs.hrc | 706 +++ inc/bf_svx/dlgutil.hxx | 45 + inc/bf_svx/dlight3d.hxx | 81 + inc/bf_svx/drawitem.hxx | 212 + inc/bf_svx/drawuiks.hxx | 77 + inc/bf_svx/e3dcmpt.hxx | 59 + inc/bf_svx/e3ditem.hxx | 79 + inc/bf_svx/editdata.hxx | 391 ++ inc/bf_svx/editdll.hxx | 62 + inc/bf_svx/editeng.hxx | 314 + inc/bf_svx/editobj.hxx | 151 + inc/bf_svx/editstat.hxx | 157 + inc/bf_svx/editund2.hxx | 70 + inc/bf_svx/editview.hxx | 111 + inc/bf_svx/eeitem.hxx | 102 + inc/bf_svx/eeitemid.hxx | 135 + inc/bf_svx/eerdll.hxx | 65 + inc/bf_svx/emphitem.hxx | 86 + inc/bf_svx/escpitem.hxx | 109 + inc/bf_svx/extrud3d.hxx | 137 + inc/bf_svx/f3dchild.hxx | 52 + inc/bf_svx/fhgtitem.hxx | 111 + inc/bf_svx/flditem.hxx | 376 ++ inc/bf_svx/float3d.hrc | 194 + inc/bf_svx/flstitem.hxx | 72 + inc/bf_svx/fmdmod.hxx | 46 + inc/bf_svx/fmdpage.hxx | 88 + inc/bf_svx/fmglob.hxx | 72 + inc/bf_svx/fmgridif.hxx | 517 ++ inc/bf_svx/fmhelp.hrc | 302 + inc/bf_svx/fmmodel.hxx | 108 + inc/bf_svx/fmobjfac.hxx | 49 + inc/bf_svx/fmpage.hxx | 92 + inc/bf_svx/fmsearch.hxx | 118 + inc/bf_svx/fmshell.hxx | 129 + inc/bf_svx/fmview.hxx | 130 + inc/bf_svx/fontitem.hxx | 117 + inc/bf_svx/forbiddencharacterstable.hxx | 74 + inc/bf_svx/forbiddenruleitem.hxx | 68 + inc/bf_svx/frmdir.hxx | 63 + inc/bf_svx/frmdiritem.hxx | 78 + inc/bf_svx/fwdtitem.hxx | 58 + inc/bf_svx/gallery.hxx | 104 + inc/bf_svx/globl3d.hxx | 66 + inc/bf_svx/globlac.hrc | 227 + inc/bf_svx/globlmn.hrc | Bin 0 -> 205416 bytes inc/bf_svx/grfcrop.hxx | 84 + inc/bf_svx/helpid.hrc | 516 ++ inc/bf_svx/hngpnctitem.hxx | 68 + inc/bf_svx/htmlmode.hxx | 56 + inc/bf_svx/hyznitem.hxx | 107 + inc/bf_svx/ifaceids.hxx | 45 + inc/bf_svx/impgrf.hxx | 60 + inc/bf_svx/itemdata.hxx | 65 + inc/bf_svx/itemtype.hxx | 84 + inc/bf_svx/keepitem.hxx | 80 + inc/bf_svx/kernitem.hxx | 79 + inc/bf_svx/label3d.hxx | 102 + inc/bf_svx/langitem.hxx | 83 + inc/bf_svx/lathe3d.hxx | 144 + inc/bf_svx/light3d.hxx | 102 + inc/bf_svx/linkmgr.hxx | 99 + inc/bf_svx/lrspitem.hxx | 185 + inc/bf_svx/lspcitem.hxx | 121 + inc/bf_svx/matrix3d.hxx | 82 + inc/bf_svx/mutxhelp.hxx | 47 + inc/bf_svx/nhypitem.hxx | 59 + inc/bf_svx/nlbkitem.hxx | 59 + inc/bf_svx/numdef.hxx | 32 + inc/bf_svx/numitem.hxx | 324 + inc/bf_svx/obj3d.hxx | 512 ++ inc/bf_svx/objfac3d.hxx | 55 + inc/bf_svx/opaqitem.hxx | 78 + inc/bf_svx/optgrid.hxx | 92 + inc/bf_svx/orphitem.hxx | 72 + inc/bf_svx/outliner.hxx | 582 ++ inc/bf_svx/outlobj.hxx | 91 + inc/bf_svx/pageitem.hxx | 147 + inc/bf_svx/paperinf.hxx | 167 + inc/bf_svx/paravertalignitem.hxx | 71 + inc/bf_svx/pbinitem.hxx | 77 + inc/bf_svx/pgrditem.hxx | 67 + inc/bf_svx/plight3d.hxx | 72 + inc/bf_svx/pmdlitem.hxx | 82 + inc/bf_svx/pntobj3d.hxx | 72 + inc/bf_svx/poly3d.hxx | 290 + inc/bf_svx/polygn3d.hxx | 85 + inc/bf_svx/polyob3d.hxx | 121 + inc/bf_svx/polypath.hxx | 89 + inc/bf_svx/polysc3d.hxx | 65 + inc/bf_svx/postattr.hxx | 89 + inc/bf_svx/postitem.hxx | 88 + inc/bf_svx/prntitem.hxx | 73 + inc/bf_svx/protitem.hxx | 100 + inc/bf_svx/prszitem.hxx | 67 + inc/bf_svx/rectenum.hxx | 50 + inc/bf_svx/rotmodit.hxx | 66 + inc/bf_svx/ruler.hxx | 204 + inc/bf_svx/rulritem.hxx | 229 + inc/bf_svx/scene3d.hxx | 322 + inc/bf_svx/scriptspaceitem.hxx | 69 + inc/bf_svx/scripttypeitem.hxx | 53 + inc/bf_svx/sdangitm.hxx | 55 + inc/bf_svx/sdasaitm.hxx | 59 + inc/bf_svx/sderitm.hxx | 48 + inc/bf_svx/sdgcoitm.hxx | 90 + inc/bf_svx/sdgcpitm.hxx | 59 + inc/bf_svx/sdggaitm.hxx | 59 + inc/bf_svx/sdginitm.hxx | 58 + inc/bf_svx/sdgluitm.hxx | 73 + inc/bf_svx/sdgmoitm.hxx | 61 + inc/bf_svx/sdgrsitm.hxx | 57 + inc/bf_svx/sdgtritm.hxx | 55 + inc/bf_svx/sdmetitm.hxx | 57 + inc/bf_svx/sdmsitm.hxx | 55 + inc/bf_svx/sdolsitm.hxx | 52 + inc/bf_svx/sdooitm.hxx | 60 + inc/bf_svx/sdprcitm.hxx | 77 + .../sdr/properties/attributeproperties.hxx | 108 + inc/bf_svx/sdshcitm.hxx | 51 + inc/bf_svx/sdshitm.hxx | 50 + inc/bf_svx/sdshsitm.hxx | 51 + inc/bf_svx/sdshtitm.hxx | 48 + inc/bf_svx/sdsxyitm.hxx | 57 + inc/bf_svx/sdtaaitm.hxx | 49 + inc/bf_svx/sdtacitm.hxx | 46 + inc/bf_svx/sdtaditm.hxx | 64 + inc/bf_svx/sdtagitm.hxx | 59 + inc/bf_svx/sdtaiitm.hxx | 53 + inc/bf_svx/sdtaitm.hxx | 91 + inc/bf_svx/sdtakitm.hxx | 108 + inc/bf_svx/sdtayitm.hxx | 48 + inc/bf_svx/sdtcfitm.hxx | 50 + inc/bf_svx/sdtditm.hxx | 66 + inc/bf_svx/sdtfsitm.hxx | 71 + inc/bf_svx/sdtmfitm.hxx | 75 + inc/bf_svx/sdynitm.hxx | 57 + inc/bf_svx/shaditem.hxx | 108 + inc/bf_svx/shdditem.hxx | 75 + inc/bf_svx/siimport.hxx | 53 + inc/bf_svx/sizeitem.hxx | 81 + inc/bf_svx/sjctrl.hxx | 634 ++ inc/bf_svx/sphere3d.hxx | 97 + inc/bf_svx/spltitem.hxx | 83 + inc/bf_svx/svdattr.hxx | 69 + inc/bf_svx/svdattrx.hxx | 79 + inc/bf_svx/svdcrtv.hxx | 187 + inc/bf_svx/svddef.hxx | 388 ++ inc/bf_svx/svddrgv.hxx | 105 + inc/bf_svx/svdedtv.hxx | 294 + inc/bf_svx/svdedxv.hxx | 176 + inc/bf_svx/svdetc.hxx | 289 + inc/bf_svx/svdfield.hxx | 71 + inc/bf_svx/svdglev.hxx | 103 + inc/bf_svx/svdglob.hxx | 64 + inc/bf_svx/svdglue.hxx | 145 + inc/bf_svx/svdhdl.hxx | 202 + inc/bf_svx/svdhlpln.hxx | 100 + inc/bf_svx/svdio.hxx | 427 ++ inc/bf_svx/svditer.hxx | 72 + inc/bf_svx/svdlayer.hxx | 185 + inc/bf_svx/svdmark.hxx | 160 + inc/bf_svx/svdmodel.hxx | 752 +++ inc/bf_svx/svdmrkv.hxx | 294 + inc/bf_svx/svdoattr.hxx | 143 + inc/bf_svx/svdobj.hxx | 1068 ++++ inc/bf_svx/svdocapt.hxx | 122 + inc/bf_svx/svdocirc.hxx | 132 + inc/bf_svx/svdoedge.hxx | 371 ++ inc/bf_svx/svdograf.hxx | 183 + inc/bf_svx/svdogrp.hxx | 208 + inc/bf_svx/svdomeas.hxx | 169 + inc/bf_svx/svdoole2.hxx | 146 + inc/bf_svx/svdopage.hxx | 83 + inc/bf_svx/svdopath.hxx | 160 + inc/bf_svx/svdorect.hxx | 142 + inc/bf_svx/svdosmbr.hxx | 224 + inc/bf_svx/svdosmev.hxx | 396 ++ inc/bf_svx/svdosmrt.hxx | 407 ++ inc/bf_svx/svdotext.hxx | 414 ++ inc/bf_svx/svdouno.hxx | 101 + inc/bf_svx/svdoutl.hxx | 59 + inc/bf_svx/svdovirt.hxx | 112 + inc/bf_svx/svdpage.hxx | 447 ++ inc/bf_svx/svdpagv.hxx | 377 ++ inc/bf_svx/svdpntv.hxx | 434 ++ inc/bf_svx/svdpoev.hxx | 104 + inc/bf_svx/svdpool.hxx | 75 + inc/bf_svx/svdshort.hxx | 100 + inc/bf_svx/svdsnpv.hxx | 327 + inc/bf_svx/svdsob.hxx | 87 + inc/bf_svx/svdstr.hrc | 120 + inc/bf_svx/svdsuro.hxx | 132 + inc/bf_svx/svdtouch.hxx | 57 + inc/bf_svx/svdtrans.hxx | 290 + inc/bf_svx/svdtypes.hxx | 182 + inc/bf_svx/svdundo.hxx | 321 + inc/bf_svx/svdview.hxx | 231 + inc/bf_svx/svdviter.hxx | 107 + inc/bf_svx/svdvmark.hxx | 162 + inc/bf_svx/svdxcgv.hxx | 114 + inc/bf_svx/svimbase.hxx | 222 + inc/bf_svx/svx3ditems.hxx | 381 ++ inc/bf_svx/svxenum.hxx | 280 + inc/bf_svx/svxerr.hxx | 70 + inc/bf_svx/svxfont.hxx | 109 + inc/bf_svx/svxids.hrc | 1510 +++++ inc/bf_svx/svxitems.hrc | 169 + inc/bf_svx/svxslots.hxx | 730 +++ inc/bf_svx/swafopt.hxx | 109 + inc/bf_svx/sxallitm.hxx | 75 + inc/bf_svx/sxcaitm.hxx | 66 + inc/bf_svx/sxcecitm.hxx | 100 + inc/bf_svx/sxcgitm.hxx | 49 + inc/bf_svx/sxciaitm.hxx | 57 + inc/bf_svx/sxcikitm.hxx | 58 + inc/bf_svx/sxcisitm.hxx | 54 + inc/bf_svx/sxcllitm.hxx | 67 + inc/bf_svx/sxcsitm.hxx | 55 + inc/bf_svx/sxctitm.hxx | 55 + inc/bf_svx/sxekitm.hxx | 61 + inc/bf_svx/sxelditm.hxx | 63 + inc/bf_svx/sxenditm.hxx | 75 + inc/bf_svx/sxesitm.hxx | 54 + inc/bf_svx/sxfiitm.hxx | 60 + inc/bf_svx/sxlayitm.hxx | 64 + inc/bf_svx/sxlogitm.hxx | 57 + inc/bf_svx/sxmbritm.hxx | 53 + inc/bf_svx/sxmfsitm.hxx | 48 + inc/bf_svx/sxmkitm.hxx | 57 + inc/bf_svx/sxmlhitm.hxx | 91 + inc/bf_svx/sxmoitm.hxx | 47 + inc/bf_svx/sxmovitm.hxx | 57 + inc/bf_svx/sxmseitm.hxx | 54 + inc/bf_svx/sxmsitm.hxx | 49 + inc/bf_svx/sxmspitm.hxx | 59 + inc/bf_svx/sxmsuitm.hxx | 48 + inc/bf_svx/sxmtaitm.hxx | 60 + inc/bf_svx/sxmtfitm.hxx | 67 + inc/bf_svx/sxmtpitm.hxx | 74 + inc/bf_svx/sxmtritm.hxx | 57 + inc/bf_svx/sxmuitm.hxx | 56 + inc/bf_svx/sxoneitm.hxx | 75 + inc/bf_svx/sxonitm.hxx | 50 + inc/bf_svx/sxopitm.hxx | 50 + inc/bf_svx/sxraitm.hxx | 48 + inc/bf_svx/sxreaitm.hxx | 59 + inc/bf_svx/sxreoitm.hxx | 59 + inc/bf_svx/sxroaitm.hxx | 48 + inc/bf_svx/sxrooitm.hxx | 48 + inc/bf_svx/sxsaitm.hxx | 48 + inc/bf_svx/sxsalitm.hxx | 57 + inc/bf_svx/sxsiitm.hxx | 47 + inc/bf_svx/sxsoitm.hxx | 57 + inc/bf_svx/sxtraitm.hxx | 75 + inc/bf_svx/tabline.hxx | 46 + inc/bf_svx/tstpitem.hxx | 176 + inc/bf_svx/twolinesitem.hxx | 93 + inc/bf_svx/txencbox.hxx | 37 + inc/bf_svx/txtrange.hxx | 111 + inc/bf_svx/ucsubset.hxx | 84 + inc/bf_svx/udlnitem.hxx | 103 + inc/bf_svx/uiks.hxx | 90 + inc/bf_svx/ulspitem.hxx | 111 + inc/bf_svx/unoapi.hxx | 102 + inc/bf_svx/unoedhlp.hxx | 133 + inc/bf_svx/unoedsrc.hxx | 478 ++ inc/bf_svx/unofdesc.hxx | 57 + inc/bf_svx/unofield.hxx | 134 + inc/bf_svx/unofill.hxx | 47 + inc/bf_svx/unofored.hxx | 94 + inc/bf_svx/unoforou.hxx | 117 + inc/bf_svx/unoipset.hxx | 81 + inc/bf_svx/unolingu.hxx | 174 + inc/bf_svx/unomaster.hxx | 67 + inc/bf_svx/unomid.hxx | 271 + inc/bf_svx/unomlstr.hxx | 61 + inc/bf_svx/unomod.hxx | 66 + inc/bf_svx/unomodel.hxx | 112 + inc/bf_svx/unonrule.hxx | 47 + inc/bf_svx/unopage.hxx | 142 + inc/bf_svx/unopool.hxx | 102 + inc/bf_svx/unoprnms.hxx | 366 ++ inc/bf_svx/unoprov.hxx | 155 + inc/bf_svx/unoshape.hxx | 716 +++ inc/bf_svx/unoshcol.hxx | 99 + inc/bf_svx/unoshprp.hxx | 485 ++ inc/bf_svx/unoshtxt.hxx | 80 + inc/bf_svx/unotext.hxx | 632 ++ inc/bf_svx/unoviwed.hxx | 68 + inc/bf_svx/unoviwou.hxx | 68 + inc/bf_svx/view3d.hxx | 271 + inc/bf_svx/viewpt3d.hxx | 147 + inc/bf_svx/volume3d.hxx | 93 + inc/bf_svx/wghtitem.hxx | 89 + inc/bf_svx/widwitem.hxx | 74 + inc/bf_svx/writingmodeitem.hxx | 64 + inc/bf_svx/wrlmitem.hxx | 77 + inc/bf_svx/xattr.hxx | 51 + inc/bf_svx/xbitmap.hxx | 93 + inc/bf_svx/xbtmpit.hxx | 74 + inc/bf_svx/xcolit.hxx | 68 + inc/bf_svx/xdash.hxx | 75 + inc/bf_svx/xdef.hxx | 140 + inc/bf_svx/xenum.hxx | 65 + inc/bf_svx/xfillit.hxx | 55 + inc/bf_svx/xfillit0.hxx | 62 + inc/bf_svx/xflasit.hxx | 58 + inc/bf_svx/xflbckit.hxx | 59 + inc/bf_svx/xflbmpit.hxx | 59 + inc/bf_svx/xflbmsli.hxx | 58 + inc/bf_svx/xflbmsxy.hxx | 82 + inc/bf_svx/xflbmtit.hxx | 58 + inc/bf_svx/xflboxy.hxx | 74 + inc/bf_svx/xflbstit.hxx | 58 + inc/bf_svx/xflbtoxy.hxx | 74 + inc/bf_svx/xflclit.hxx | 61 + inc/bf_svx/xflftrit.hxx | 75 + inc/bf_svx/xflgrit.hxx | 75 + inc/bf_svx/xflhtit.hxx | 74 + inc/bf_svx/xfltrit.hxx | 54 + inc/bf_svx/xftadit.hxx | 59 + inc/bf_svx/xftdiit.hxx | 54 + inc/bf_svx/xftmrit.hxx | 56 + inc/bf_svx/xftouit.hxx | 54 + inc/bf_svx/xftsfit.hxx | 57 + inc/bf_svx/xftshcit.hxx | 56 + inc/bf_svx/xftshit.hxx | 59 + inc/bf_svx/xftshtit.hxx | 54 + inc/bf_svx/xftshxy.hxx | 70 + inc/bf_svx/xftstit.hxx | 54 + inc/bf_svx/xgrad.hxx | 91 + inc/bf_svx/xgrscit.hxx | 54 + inc/bf_svx/xhatch.hxx | 70 + inc/bf_svx/xiocomp.hxx | 62 + inc/bf_svx/xit.hxx | 91 + inc/bf_svx/xlineit.hxx | 44 + inc/bf_svx/xlineit0.hxx | 58 + inc/bf_svx/xlinjoit.hxx | 61 + inc/bf_svx/xlnasit.hxx | 58 + inc/bf_svx/xlnclit.hxx | 57 + inc/bf_svx/xlndsit.hxx | 75 + inc/bf_svx/xlnedcit.hxx | 57 + inc/bf_svx/xlnedit.hxx | 71 + inc/bf_svx/xlnedwit.hxx | 58 + inc/bf_svx/xlnstcit.hxx | 57 + inc/bf_svx/xlnstit.hxx | 71 + inc/bf_svx/xlnstwit.hxx | 58 + inc/bf_svx/xlntrit.hxx | 54 + inc/bf_svx/xlnwtit.hxx | 55 + inc/bf_svx/xmlcnitm.hxx | 87 + inc/bf_svx/xmleohlp.hxx | 146 + inc/bf_svx/xmlgrhlp.hxx | 135 + inc/bf_svx/xoutbmp.hxx | 80 + inc/bf_svx/xoutx.hxx | 289 + inc/bf_svx/xpoly.hxx | 186 + inc/bf_svx/xpolyimp.hxx | 109 + inc/bf_svx/xpool.hxx | 83 + inc/bf_svx/xtable.hxx | 426 ++ inc/bf_svx/xtextit0.hxx | 78 + inc/bf_svx/xtxasit.hxx | 57 + inc/bf_svx/zoomitem.hxx | 91 + inc/bf_sw/RefreshListenerContainer.hxx | 43 + inc/bf_sw/SwGetPoolIdFromName.hxx | 47 + inc/bf_sw/SwStyleNameMapper.hxx | 252 + inc/bf_sw/TextCursorHelper.hxx | 58 + inc/bf_sw/access.hrc | 36 + inc/bf_sw/accessibilityoptions.hxx | 58 + inc/bf_sw/acmplwrd.hxx | 80 + inc/bf_sw/authfld.hxx | 199 + inc/bf_sw/authratr.hxx | 58 + inc/bf_sw/bkmrke.hxx | 41 + inc/bf_sw/bookmrk.hxx | 129 + inc/bf_sw/bparr.hxx | 130 + inc/bf_sw/breakit.hxx | 86 + inc/bf_sw/calbck.hxx | 228 + inc/bf_sw/calc.hxx | 235 + inc/bf_sw/cellatr.hxx | 138 + inc/bf_sw/cellfml.hxx | 148 + inc/bf_sw/charatr.hxx | 176 + inc/bf_sw/charfmt.hxx | 57 + inc/bf_sw/chcmprse.hxx | 44 + inc/bf_sw/checkit.hxx | 62 + inc/bf_sw/chpfld.hxx | 99 + inc/bf_sw/cmdid.h | 1227 ++++ inc/bf_sw/comcore.hrc | 75 + inc/bf_sw/crsrsh.hxx | 336 + inc/bf_sw/crsskip.hxx | 46 + inc/bf_sw/crstate.hxx | 198 + inc/bf_sw/cshtyp.hxx | 110 + inc/bf_sw/dbfld.hxx | 339 ++ inc/bf_sw/dbmgr.hxx | 267 + inc/bf_sw/dcontact.hxx | 351 ++ inc/bf_sw/ddefld.hxx | 124 + inc/bf_sw/dlelstnr.hxx | 106 + inc/bf_sw/dobjfac.hxx | 51 + inc/bf_sw/doc.hxx | 1477 +++++ inc/bf_sw/docary.hxx | 130 + inc/bf_sw/docfac.hxx | 52 + inc/bf_sw/docsh.hxx | 200 + inc/bf_sw/docstat.hxx | 60 + inc/bf_sw/docstyle.hxx | 208 + inc/bf_sw/docufld.hxx | 816 +++ inc/bf_sw/dpage.hxx | 68 + inc/bf_sw/drawdoc.hxx | 69 + inc/bf_sw/editsh.hxx | 250 + inc/bf_sw/expfld.hxx | 417 ++ inc/bf_sw/extinput.hxx | 62 + inc/bf_sw/fchrfmt.hxx | 81 + inc/bf_sw/fesh.hxx | 206 + inc/bf_sw/fldbas.hxx | 471 ++ inc/bf_sw/flddat.hxx | 151 + inc/bf_sw/flddropdown.hxx | 233 + inc/bf_sw/fldupde.hxx | 44 + inc/bf_sw/flyenum.hxx | 59 + inc/bf_sw/fmtanchr.hxx | 90 + inc/bf_sw/fmtclbl.hxx | 64 + inc/bf_sw/fmtclds.hxx | 173 + inc/bf_sw/fmtcnct.hxx | 87 + inc/bf_sw/fmtcntnt.hxx | 71 + inc/bf_sw/fmtcol.hxx | 227 + inc/bf_sw/fmteiro.hxx | 63 + inc/bf_sw/fmtflcnt.hxx | 67 + inc/bf_sw/fmtfld.hxx | 83 + inc/bf_sw/fmtfordr.hxx | 80 + inc/bf_sw/fmtfsize.hxx | 114 + inc/bf_sw/fmtftn.hxx | 87 + inc/bf_sw/fmtftntx.hxx | 134 + inc/bf_sw/fmthbsh.hxx | 82 + inc/bf_sw/fmthdft.hxx | 112 + inc/bf_sw/fmtinfmt.hxx | 115 + inc/bf_sw/fmtline.hxx | 75 + inc/bf_sw/fmtlsplt.hxx | 60 + inc/bf_sw/fmtornt.hxx | 145 + inc/bf_sw/fmtpdsc.hxx | 104 + inc/bf_sw/fmtrfmrk.hxx | 68 + inc/bf_sw/fmtruby.hxx | 94 + inc/bf_sw/fmtsrnd.hxx | 103 + inc/bf_sw/fmturl.hxx | 92 + inc/bf_sw/format.hxx | 311 + inc/bf_sw/frmatr.hxx | 102 + inc/bf_sw/frmfmt.hxx | 218 + inc/bf_sw/ftnidx.hxx | 83 + inc/bf_sw/ftninfo.hxx | 116 + inc/bf_sw/globals.hrc | 209 + inc/bf_sw/globdoc.hxx | 56 + inc/bf_sw/grfatr.hxx | 349 ++ inc/bf_sw/helpid.h | 885 +++ inc/bf_sw/hfspacingitem.hxx | 72 + inc/bf_sw/hintids.hxx | 471 ++ inc/bf_sw/hints.hxx | 286 + inc/bf_sw/horiornt.hxx | 63 + inc/bf_sw/index.hxx | 186 + inc/bf_sw/inetfld.hxx | 116 + inc/bf_sw/init.hxx | 49 + inc/bf_sw/io.hxx | 158 + inc/bf_sw/iodetect.hxx | 636 ++ inc/bf_sw/itabenum.hxx | 47 + inc/bf_sw/lineinfo.hxx | 112 + inc/bf_sw/linetype.hxx | 61 + inc/bf_sw/linkenum.hxx | 43 + inc/bf_sw/mdiexp.hxx | 85 + inc/bf_sw/ndarr.hxx | 285 + inc/bf_sw/ndgrf.hxx | 192 + inc/bf_sw/ndhints.hxx | 224 + inc/bf_sw/ndindex.hxx | 255 + inc/bf_sw/ndnotxt.hxx | 121 + inc/bf_sw/ndole.hxx | 144 + inc/bf_sw/ndtxt.hxx | 339 ++ inc/bf_sw/ndtyp.hxx | 74 + inc/bf_sw/newhdl.hxx | 78 + inc/bf_sw/node.hxx | 652 ++ inc/bf_sw/numrule.hxx | 290 + inc/bf_sw/orntenum.hxx | 69 + inc/bf_sw/pagedesc.hxx | 313 + inc/bf_sw/pam.hxx | 197 + inc/bf_sw/paratr.hxx | 275 + inc/bf_sw/poolfmt.awk | 71 + inc/bf_sw/poolfmt.hrc | 271 + inc/bf_sw/poolfmt.hxx | 441 ++ inc/bf_sw/printdata.hxx | 119 + inc/bf_sw/pvprtdat.hxx | 88 + inc/bf_sw/rcid.hrc | 251 + inc/bf_sw/redlenum.hxx | 96 + inc/bf_sw/redline.hxx | 194 + inc/bf_sw/redlnaut.hxx | 74 + inc/bf_sw/reffld.hxx | 130 + inc/bf_sw/ring.hxx | 52 + inc/bf_sw/rubylist.hxx | 59 + inc/bf_sw/section.hxx | 280 + inc/bf_sw/shellid.hxx | 74 + inc/bf_sw/shellio.hxx | 513 ++ inc/bf_sw/shellres.hxx | 107 + inc/bf_sw/sortopt.hxx | 74 + inc/bf_sw/statstr.hrc | 43 + inc/bf_sw/sw.mk | 33 + inc/bf_sw/sw3io.hxx | 76 + inc/bf_sw/swatrset.hxx | 337 + inc/bf_sw/swbaslnk.hxx | 87 + inc/bf_sw/swcalwrp.hxx | 57 + inc/bf_sw/swcrsr.hxx | 220 + inc/bf_sw/swdbdata.hxx | 54 + inc/bf_sw/swddetbl.hxx | 62 + inc/bf_sw/swdll.hxx | 130 + inc/bf_sw/swerror.h | 129 + inc/bf_sw/swevent.hxx | 117 + inc/bf_sw/swfltopt.hxx | 49 + inc/bf_sw/swgpar.hxx | 77 + inc/bf_sw/swgstr.hxx | 160 + inc/bf_sw/swhints.hxx | 40 + inc/bf_sw/swmodule.hxx | 205 + inc/bf_sw/swpre.mk | 46 + inc/bf_sw/swprtopt.hxx | 97 + inc/bf_sw/swrect.hxx | 392 ++ inc/bf_sw/swregion.hxx | 43 + inc/bf_sw/swserv.hxx | 91 + inc/bf_sw/swstyle.h | 43 + inc/bf_sw/swtable.hxx | 285 + inc/bf_sw/swtblfmt.hxx | 104 + inc/bf_sw/swtypes.hxx | 261 + inc/bf_sw/swunodef.hxx | 41 + inc/bf_sw/swunohelper.hxx | 57 + inc/bf_sw/swwait.hxx | 49 + inc/bf_sw/tabcol.hxx | 90 + inc/bf_sw/tblafmt.hxx | 81 + inc/bf_sw/tblenum.hxx | 82 + inc/bf_sw/tblsel.hxx | 206 + inc/bf_sw/tgrditem.hxx | 104 + inc/bf_sw/tox.hxx | 683 +++ inc/bf_sw/toxe.hxx | 129 + inc/bf_sw/toxwrap.hxx | 75 + inc/bf_sw/txatbase.hxx | 433 ++ inc/bf_sw/txatritr.hxx | 84 + inc/bf_sw/txtatr.hxx | 96 + inc/bf_sw/txtflcnt.hxx | 72 + inc/bf_sw/txtfld.hxx | 72 + inc/bf_sw/txtftn.hxx | 89 + inc/bf_sw/txtinet.hxx | 84 + inc/bf_sw/txtrfmrk.hxx | 63 + inc/bf_sw/txttxmrk.hxx | 69 + inc/bf_sw/undobj.hxx | 780 +++ inc/bf_sw/unoatxt.hxx | 304 + inc/bf_sw/unobaseclass.hxx | 47 + inc/bf_sw/unocoll.hxx | 475 ++ inc/bf_sw/unocrsr.hxx | 102 + inc/bf_sw/unocrsrhelper.hxx | 90 + inc/bf_sw/unodraw.hxx | 242 + inc/bf_sw/unoevent.hxx | 123 + inc/bf_sw/unoevtlstnr.hxx | 65 + inc/bf_sw/unofield.hxx | 316 + inc/bf_sw/unoframe.hxx | 352 ++ inc/bf_sw/unoidx.hxx | 340 ++ inc/bf_sw/unomailmerge.hxx | 182 + inc/bf_sw/unomap.hxx | 317 + inc/bf_sw/unomid.h | 136 + inc/bf_sw/unomod.hxx | 200 + inc/bf_sw/unoobj.hxx | 1235 ++++ inc/bf_sw/unoport.hxx | 212 + inc/bf_sw/unoprnms.hxx | 747 +++ inc/bf_sw/unoredline.hxx | 158 + inc/bf_sw/unoredlines.hxx | 110 + inc/bf_sw/unosett.hxx | 325 + inc/bf_sw/unosrch.hxx | 143 + inc/bf_sw/unostyle.hxx | 314 + inc/bf_sw/unotbl.hxx | 584 ++ inc/bf_sw/unotxdoc.hxx | 527 ++ inc/bf_sw/usrfld.hxx | 137 + inc/bf_sw/viewopt.hxx | 543 ++ inc/bf_sw/viewsh.hxx | 211 + inc/bf_sw/viscrs.hxx | 161 + inc/bf_sw/wdocsh.hxx | 53 + inc/bf_tools/contnr.hxx | 124 + inc/bf_tools/impcont.hxx | 147 + inc/bf_tools/ownlist.hxx | 98 + inc/bf_tools/stack.hxx | 107 + inc/bf_tools/string.hxx | 43 + inc/bf_tools/unqid.hxx | 113 + inc/bf_tools/unqidx.hxx | 152 + inc/bf_xmloff/AttributeContainerHandler.hxx | 52 + inc/bf_xmloff/ControlBorderHandler.hxx | 74 + inc/bf_xmloff/DashStyle.hxx | 74 + inc/bf_xmloff/DocumentSettingsContext.hxx | 59 + inc/bf_xmloff/EnumPropertyHdl.hxx | 59 + inc/bf_xmloff/GradientStyle.hxx | 76 + inc/bf_xmloff/HatchStyle.hxx | 74 + inc/bf_xmloff/ImageStyle.hxx | 62 + inc/bf_xmloff/MarkerStyle.hxx | 76 + inc/bf_xmloff/MetaExportComponent.hxx | 75 + inc/bf_xmloff/MetaImportComponent.hxx | 86 + inc/bf_xmloff/MultiPropertySetHelper.hxx | 208 + inc/bf_xmloff/NamedBoolPropertyHdl.hxx | 71 + inc/bf_xmloff/PageMasterImportContext.hxx | 69 + inc/bf_xmloff/PageMasterStyleMap.hxx | 155 + inc/bf_xmloff/ProgressBarHelper.hxx | 79 + inc/bf_xmloff/PropertySetInfoHash.hxx | 70 + inc/bf_xmloff/PropertySetInfoKey.hxx | 71 + inc/bf_xmloff/PropertySetMerger.hxx | 43 + inc/bf_xmloff/SchXMLExport.hxx | 92 + inc/bf_xmloff/SchXMLExportHelper.hxx | 177 + inc/bf_xmloff/SchXMLImport.hxx | 187 + inc/bf_xmloff/SchXMLImportHelper.hxx | 146 + inc/bf_xmloff/SettingsExportHelper.hxx | 96 + inc/bf_xmloff/SinglePropertySetInfoCache.hxx | 86 + inc/bf_xmloff/TransGradientStyle.hxx | 76 + inc/bf_xmloff/XMLBackgroundImageContext.hxx | 88 + inc/bf_xmloff/XMLBackgroundImageExport.hxx | 67 + inc/bf_xmloff/XMLBase64Export.hxx | 62 + inc/bf_xmloff/XMLBase64ImportContext.hxx | 67 + inc/bf_xmloff/XMLBasicExportFilter.hxx | 83 + .../XMLBitmapLogicalSizePropertyHandler.hxx | 67 + .../XMLBitmapRepeatOffsetPropertyHandler.hxx | 70 + inc/bf_xmloff/XMLChartPropertySetMapper.hxx | 129 + inc/bf_xmloff/XMLChartStyleContext.hxx | 71 + inc/bf_xmloff/XMLClipPropertyHandler.hxx | 51 + inc/bf_xmloff/XMLConstantsPropertyHandler.hxx | 74 + inc/bf_xmloff/XMLElementPropertyContext.hxx | 73 + .../XMLEmbeddedObjectExportFilter.hxx | 97 + .../XMLEmbeddedObjectImportContext.hxx | 87 + inc/bf_xmloff/XMLEventExport.hxx | 137 + inc/bf_xmloff/XMLEventImportHelper.hxx | 111 + inc/bf_xmloff/XMLEventsImportContext.hxx | 137 + .../XMLFillBitmapSizePropertyHandler.hxx | 67 + inc/bf_xmloff/XMLFilterServiceNames.h | 48 + inc/bf_xmloff/XMLFontAutoStylePool.hxx | 79 + inc/bf_xmloff/XMLFontStylesContext.hxx | 99 + .../XMLFootnoteConfigurationImportContext.hxx | 126 + inc/bf_xmloff/XMLGraphicsDefaultStyle.hxx | 65 + inc/bf_xmloff/XMLImageMapContext.hxx | 82 + inc/bf_xmloff/XMLImageMapExport.hxx | 123 + ...LIndexBibliographyConfigurationContext.hxx | 117 + .../XMLIsPercentagePropertyHandler.hxx | 57 + .../XMLLineNumberingImportContext.hxx | 133 + inc/bf_xmloff/XMLNumberStylesImport.hxx | 84 + inc/bf_xmloff/XMLPageExport.hxx | 113 + .../XMLPercentOrMeasurePropertyHandler.hxx | 59 + inc/bf_xmloff/XMLRectangleMembersHandler.hxx | 69 + inc/bf_xmloff/XMLScriptContextFactory.hxx | 72 + inc/bf_xmloff/XMLScriptExportHandler.hxx | 65 + inc/bf_xmloff/XMLShapePropertySetContext.hxx | 66 + inc/bf_xmloff/XMLShapeStyleContext.hxx | 80 + inc/bf_xmloff/XMLStarBasicContextFactory.hxx | 73 + inc/bf_xmloff/XMLStarBasicExportHandler.hxx | 70 + .../XMLStringBufferImportContext.hxx | 74 + inc/bf_xmloff/XMLTextColumnsContext.hxx | 84 + inc/bf_xmloff/XMLTextColumnsExport.hxx | 63 + .../XMLTextColumnsPropertyHandler.hxx | 61 + inc/bf_xmloff/XMLTextHeaderFooterContext.hxx | 80 + inc/bf_xmloff/XMLTextListAutoStylePool.hxx | 82 + inc/bf_xmloff/XMLTextMasterPageContext.hxx | 91 + inc/bf_xmloff/XMLTextMasterPageExport.hxx | 74 + inc/bf_xmloff/XMLTextMasterStylesContext.hxx | 64 + inc/bf_xmloff/XMLTextShapeImportHelper.hxx | 60 + inc/bf_xmloff/XMLTextShapeStyleContext.hxx | 75 + inc/bf_xmloff/XMLTextTableContext.hxx | 63 + inc/bf_xmloff/anim.hxx | 111 + inc/bf_xmloff/animexp.hxx | 57 + inc/bf_xmloff/animimp.hxx | 61 + inc/bf_xmloff/attrlist.hxx | 85 + inc/bf_xmloff/contextid.hxx | 52 + inc/bf_xmloff/families.hxx | 113 + inc/bf_xmloff/formlayerexport.hxx | 186 + inc/bf_xmloff/formlayerimport.hxx | 166 + inc/bf_xmloff/functional.hxx | 31 + inc/bf_xmloff/i18nmap.hxx | 68 + inc/bf_xmloff/maptype.hxx | 79 + inc/bf_xmloff/nmspmap.hxx | 162 + inc/bf_xmloff/numehelp.hxx | 133 + inc/bf_xmloff/prhdlfac.hxx | 113 + inc/bf_xmloff/prstylei.hxx | 107 + inc/bf_xmloff/sdxmlexp.hxx | 52 + inc/bf_xmloff/sdxmlimp.hxx | 55 + inc/bf_xmloff/shapeexport.hxx | 323 + inc/bf_xmloff/shapeimport.hxx | 388 ++ inc/bf_xmloff/styleexp.hxx | 125 + inc/bf_xmloff/txtflde.hxx | 495 ++ inc/bf_xmloff/txtfldi.hxx | 1415 +++++ inc/bf_xmloff/txtimp.hxx | 857 +++ inc/bf_xmloff/txtparae.hxx | 708 +++ inc/bf_xmloff/txtprmap.hxx | 177 + inc/bf_xmloff/txtstyle.hxx | 65 + inc/bf_xmloff/txtstyli.hxx | 106 + inc/bf_xmloff/txtvfldi.hxx | 579 ++ inc/bf_xmloff/uniref.hxx | 232 + inc/bf_xmloff/unoatrcn.hxx | 85 + inc/bf_xmloff/xexptran.hxx | 203 + inc/bf_xmloff/xmlaustp.hxx | 115 + inc/bf_xmloff/xmlcnimp.hxx | 132 + inc/bf_xmloff/xmlcnitm.hxx | 96 + inc/bf_xmloff/xmlehelp.hxx | 54 + inc/bf_xmloff/xmlement.hxx | 63 + inc/bf_xmloff/xmlerror.hxx | 141 + inc/bf_xmloff/xmlevent.hxx | 127 + inc/bf_xmloff/xmlexp.hxx | 560 ++ inc/bf_xmloff/xmlexppr.hxx | 179 + inc/bf_xmloff/xmlictxt.hxx | 107 + inc/bf_xmloff/xmlimp.hxx | 413 ++ inc/bf_xmloff/xmlimppr.hxx | 159 + inc/bf_xmloff/xmlkywd.hxx | 1991 ++++++ inc/bf_xmloff/xmlmetae.hxx | 85 + inc/bf_xmloff/xmlmetai.hxx | 96 + inc/bf_xmloff/xmlnmspe.hxx | 82 + inc/bf_xmloff/xmlnume.hxx | 102 + inc/bf_xmloff/xmlnumfe.hxx | 142 + inc/bf_xmloff/xmlnumfi.hxx | 230 + inc/bf_xmloff/xmlnumi.hxx | 117 + inc/bf_xmloff/xmlprcon.hxx | 81 + inc/bf_xmloff/xmlprhdl.hxx | 67 + inc/bf_xmloff/xmlprmap.hxx | 175 + inc/bf_xmloff/xmlreg.hxx | 47 + inc/bf_xmloff/xmlscripti.hxx | 71 + inc/bf_xmloff/xmlstyle.hxx | 265 + inc/bf_xmloff/xmltabe.hxx | 60 + inc/bf_xmloff/xmltabi.hxx | 69 + inc/bf_xmloff/xmltkmap.hxx | 70 + inc/bf_xmloff/xmltoken.hxx | 2139 +++++++ inc/bf_xmloff/xmltypes.hxx | 234 + inc/bf_xmloff/xmluconv.hxx | 364 ++ inc/legacysmgr/legacy_binfilters_smgr.hxx | 28 + legacysmgr/source/legacy/gcc3.map | 7 + .../source/legacy/legacy_binfilters_smgr.cxx | 2099 +++++++ legacysmgr/source/legacy/makefile.mk | 81 + legacysmgr/source/legacy/mingw_intel.map | 7 + legacysmgr/source/legacy/msci.map | 7 + legacysmgr/source/legacy/sols.map | 7 + no_localization | 1 + prj/build.lst | 164 + prj/d.lst | 7 + prj/l10n | 1 + qa/cppunit/data/sdw/fail/.gitignore | 0 qa/cppunit/data/sdw/indeterminate/.gitignore | 0 qa/cppunit/data/sdw/pass/.gitignore | 0 qa/cppunit/data/sdw/pass/rsc.sdw | 4096 +++++++++++++ qa/cppunit/data/sdw/pass/rscerror.sdw | 2119 +++++++ qa/cppunit/data/sdw/pass/rscinst.sdw | 4138 +++++++++++++ qa/cppunit/makefile.mk | 115 + qa/cppunit/test_binfilter.cxx | 98 + util/makefile.mk | 49 + 3650 files changed, 1163249 insertions(+) create mode 100644 bf_basic/source/basmgr/basmgr.cxx create mode 100644 bf_basic/source/basmgr/makefile.mk create mode 100644 bf_basic/source/classes/image.cxx create mode 100644 bf_basic/source/classes/makefile.mk create mode 100644 bf_basic/source/classes/sb.cxx create mode 100644 bf_basic/source/classes/sbintern.cxx create mode 100644 bf_basic/source/classes/sbunoobj.cxx create mode 100644 bf_basic/source/classes/sbxmod.cxx create mode 100644 bf_basic/source/comp/buffer.cxx create mode 100644 bf_basic/source/comp/codegen.cxx create mode 100644 bf_basic/source/comp/makefile.mk create mode 100644 bf_basic/source/comp/parser.cxx create mode 100644 bf_basic/source/comp/sbcomp.cxx create mode 100644 bf_basic/source/comp/scanner.cxx create mode 100644 bf_basic/source/comp/token.cxx create mode 100644 bf_basic/source/inc/buffer.hxx create mode 100644 bf_basic/source/inc/codegen.hxx create mode 100644 bf_basic/source/inc/filefmt.hxx create mode 100644 bf_basic/source/inc/image.hxx create mode 100644 bf_basic/source/inc/opcodes.hxx create mode 100644 bf_basic/source/inc/sbintern.hxx create mode 100644 bf_basic/source/inc/sbjsmeth.hxx create mode 100644 bf_basic/source/inc/sbjsmod.hxx create mode 100644 bf_basic/source/inc/sbunoobj.hxx create mode 100644 bf_basic/source/inc/scanner.hxx create mode 100644 bf_basic/source/inc/token.hxx create mode 100644 bf_basic/source/runtime/basrdll.cxx create mode 100644 bf_basic/source/runtime/makefile.mk create mode 100644 bf_basic/source/sbx/makefile.mk create mode 100644 bf_basic/source/sbx/sbxarray.cxx create mode 100644 bf_basic/source/sbx/sbxbase.cxx create mode 100644 bf_basic/source/sbx/sbxbool.cxx create mode 100644 bf_basic/source/sbx/sbxbyte.cxx create mode 100644 bf_basic/source/sbx/sbxchar.cxx create mode 100644 bf_basic/source/sbx/sbxcoll.cxx create mode 100644 bf_basic/source/sbx/sbxconv.hxx create mode 100644 bf_basic/source/sbx/sbxcurr.cxx create mode 100644 bf_basic/source/sbx/sbxdate.cxx create mode 100644 bf_basic/source/sbx/sbxdbl.cxx create mode 100644 bf_basic/source/sbx/sbxdec.cxx create mode 100644 bf_basic/source/sbx/sbxdec.hxx create mode 100644 bf_basic/source/sbx/sbxexec.cxx create mode 100644 bf_basic/source/sbx/sbxint.cxx create mode 100644 bf_basic/source/sbx/sbxlng.cxx create mode 100644 bf_basic/source/sbx/sbxobj.cxx create mode 100644 bf_basic/source/sbx/sbxres.cxx create mode 100644 bf_basic/source/sbx/sbxres.hxx create mode 100644 bf_basic/source/sbx/sbxscan.cxx create mode 100644 bf_basic/source/sbx/sbxsng.cxx create mode 100644 bf_basic/source/sbx/sbxstr.cxx create mode 100644 bf_basic/source/sbx/sbxuint.cxx create mode 100644 bf_basic/source/sbx/sbxulng.cxx create mode 100644 bf_basic/source/sbx/sbxvalue.cxx create mode 100644 bf_basic/source/sbx/sbxvar.cxx create mode 100644 bf_basic/util/makefile.mk create mode 100644 bf_forms/source/component/BaseListBox.hxx create mode 100644 bf_forms/source/component/Button.hxx create mode 100644 bf_forms/source/component/CheckBox.hxx create mode 100644 bf_forms/source/component/Columns.hxx create mode 100644 bf_forms/source/component/ComboBox.hxx create mode 100644 bf_forms/source/component/Currency.hxx create mode 100644 bf_forms/source/component/DatabaseForm.hxx create mode 100644 bf_forms/source/component/Date.hxx create mode 100644 bf_forms/source/component/Edit.hxx create mode 100644 bf_forms/source/component/EditBase.hxx create mode 100644 bf_forms/source/component/EventThread.hxx create mode 100644 bf_forms/source/component/File.hxx create mode 100644 bf_forms/source/component/Filter.hxx create mode 100644 bf_forms/source/component/FixedText.hxx create mode 100644 bf_forms/source/component/FormComponent.hxx create mode 100644 bf_forms/source/component/FormattedField.hxx create mode 100644 bf_forms/source/component/FormattedFieldWrapper.hxx create mode 100644 bf_forms/source/component/FormsCollection.hxx create mode 100644 bf_forms/source/component/Grid.hxx create mode 100644 bf_forms/source/component/GroupBox.hxx create mode 100644 bf_forms/source/component/GroupManager.hxx create mode 100644 bf_forms/source/component/Hidden.hxx create mode 100644 bf_forms/source/component/Image.hxx create mode 100644 bf_forms/source/component/ImageButton.hxx create mode 100644 bf_forms/source/component/ImageControl.hxx create mode 100644 bf_forms/source/component/ListBox.hxx create mode 100644 bf_forms/source/component/Numeric.hxx create mode 100644 bf_forms/source/component/Pattern.hxx create mode 100644 bf_forms/source/component/RadioButton.hxx create mode 100644 bf_forms/source/component/Time.hxx create mode 100644 bf_forms/source/component/cloneable.hxx create mode 100644 bf_forms/source/component/errorbroadcaster.hxx create mode 100644 bf_forms/source/component/forms_Button.cxx create mode 100644 bf_forms/source/component/forms_CheckBox.cxx create mode 100644 bf_forms/source/component/forms_Columns.cxx create mode 100644 bf_forms/source/component/forms_ComboBox.cxx create mode 100644 bf_forms/source/component/forms_Currency.cxx create mode 100644 bf_forms/source/component/forms_DatabaseForm.cxx create mode 100644 bf_forms/source/component/forms_Date.cxx create mode 100644 bf_forms/source/component/forms_Edit.cxx create mode 100644 bf_forms/source/component/forms_EditBase.cxx create mode 100644 bf_forms/source/component/forms_EventThread.cxx create mode 100644 bf_forms/source/component/forms_File.cxx create mode 100644 bf_forms/source/component/forms_Filter.cxx create mode 100644 bf_forms/source/component/forms_FixedText.cxx create mode 100644 bf_forms/source/component/forms_FormComponent.cxx create mode 100644 bf_forms/source/component/forms_FormattedField.cxx create mode 100644 bf_forms/source/component/forms_FormattedFieldWrapper.cxx create mode 100644 bf_forms/source/component/forms_FormsCollection.cxx create mode 100644 bf_forms/source/component/forms_Grid.cxx create mode 100644 bf_forms/source/component/forms_GroupBox.cxx create mode 100644 bf_forms/source/component/forms_GroupManager.cxx create mode 100644 bf_forms/source/component/forms_Hidden.cxx create mode 100644 bf_forms/source/component/forms_Image.cxx create mode 100644 bf_forms/source/component/forms_ImageButton.cxx create mode 100644 bf_forms/source/component/forms_ImageControl.cxx create mode 100644 bf_forms/source/component/forms_ListBox.cxx create mode 100644 bf_forms/source/component/forms_Numeric.cxx create mode 100644 bf_forms/source/component/forms_Pattern.cxx create mode 100644 bf_forms/source/component/forms_RadioButton.cxx create mode 100644 bf_forms/source/component/forms_Time.cxx create mode 100644 bf_forms/source/component/forms_cloneable.cxx create mode 100644 bf_forms/source/component/forms_errorbroadcaster.cxx create mode 100644 bf_forms/source/component/forms_imgprod.cxx create mode 100644 bf_forms/source/component/imgprod.hxx create mode 100644 bf_forms/source/component/makefile.mk create mode 100644 bf_forms/source/inc/InterfaceContainer.hxx create mode 100644 bf_forms/source/inc/formsmodule.hxx create mode 100644 bf_forms/source/inc/frm_resource.hrc create mode 100644 bf_forms/source/inc/frm_resource.hxx create mode 100644 bf_forms/source/inc/ids.hxx create mode 100644 bf_forms/source/inc/limitedformats.hxx create mode 100644 bf_forms/source/inc/property.hrc create mode 100644 bf_forms/source/inc/property.hxx create mode 100644 bf_forms/source/inc/services.hxx create mode 100644 bf_forms/source/inc/strings.hxx create mode 100644 bf_forms/source/misc/forms_InterfaceContainer.cxx create mode 100644 bf_forms/source/misc/forms_formsmodule.cxx create mode 100644 bf_forms/source/misc/forms_ids.cxx create mode 100644 bf_forms/source/misc/forms_limitedformats.cxx create mode 100644 bf_forms/source/misc/forms_property.cxx create mode 100644 bf_forms/source/misc/forms_services.cxx create mode 100644 bf_forms/source/misc/makefile.mk create mode 100644 bf_forms/source/resource/forms_frm_resource.cxx create mode 100644 bf_forms/source/resource/forms_strings.src create mode 100644 bf_forms/source/resource/makefile.mk create mode 100644 bf_forms/util/bf_frm.component create mode 100644 bf_forms/util/frm.dxp create mode 100644 bf_forms/util/frm.xml create mode 100644 bf_forms/util/makefile.mk create mode 100644 bf_goodies/source/base2d/goodies_graphicobject.cxx create mode 100644 bf_goodies/source/base2d/goodies_matrix3d.cxx create mode 100644 bf_goodies/source/base2d/goodies_point3d.cxx create mode 100644 bf_goodies/source/base2d/makefile.mk create mode 100644 bf_goodies/source/base3d/goodies_b3dcolor.cxx create mode 100644 bf_goodies/source/base3d/goodies_b3dcompo.cxx create mode 100644 bf_goodies/source/base3d/goodies_b3dentty.cxx create mode 100644 bf_goodies/source/base3d/goodies_b3dgeom.cxx create mode 100644 bf_goodies/source/base3d/goodies_b3dlight.cxx create mode 100644 bf_goodies/source/base3d/goodies_b3dtrans.cxx create mode 100644 bf_goodies/source/base3d/goodies_b3dvolum.cxx create mode 100644 bf_goodies/source/base3d/goodies_hmatrix.cxx create mode 100644 bf_goodies/source/base3d/goodies_matril3d.cxx create mode 100644 bf_goodies/source/base3d/goodies_point4d.cxx create mode 100644 bf_goodies/source/base3d/goodies_vector3d.cxx create mode 100644 bf_goodies/source/base3d/makefile.mk create mode 100644 bf_goodies/util/makefile.mk create mode 100644 bf_offmgr/source/offapp/app/makefile.mk create mode 100644 bf_offmgr/source/offapp/app/offmgr_app.cxx create mode 100644 bf_offmgr/util/makefile.mk create mode 100644 bf_offmgr/util/makefile.pmk create mode 100644 bf_sc/source/core/data/makefile.mk create mode 100644 bf_sc/source/core/data/sc_attarray.cxx create mode 100644 bf_sc/source/core/data/sc_attrib.cxx create mode 100644 bf_sc/source/core/data/sc_bcaslot.cxx create mode 100644 bf_sc/source/core/data/sc_bclist.cxx create mode 100644 bf_sc/source/core/data/sc_cell.cxx create mode 100644 bf_sc/source/core/data/sc_cell2.cxx create mode 100644 bf_sc/source/core/data/sc_column.cxx create mode 100644 bf_sc/source/core/data/sc_column2.cxx create mode 100644 bf_sc/source/core/data/sc_column3.cxx create mode 100644 bf_sc/source/core/data/sc_conditio.cxx create mode 100644 bf_sc/source/core/data/sc_dbdocutl.cxx create mode 100644 bf_sc/source/core/data/sc_dociter.cxx create mode 100644 bf_sc/source/core/data/sc_docpool.cxx create mode 100644 bf_sc/source/core/data/sc_documen2.cxx create mode 100644 bf_sc/source/core/data/sc_documen3.cxx create mode 100644 bf_sc/source/core/data/sc_documen4.cxx create mode 100644 bf_sc/source/core/data/sc_documen5.cxx create mode 100644 bf_sc/source/core/data/sc_documen6.cxx create mode 100644 bf_sc/source/core/data/sc_documen7.cxx create mode 100644 bf_sc/source/core/data/sc_documen8.cxx create mode 100644 bf_sc/source/core/data/sc_documen9.cxx create mode 100644 bf_sc/source/core/data/sc_document.cxx create mode 100644 bf_sc/source/core/data/sc_dpobject.cxx create mode 100644 bf_sc/source/core/data/sc_dpoutput.cxx create mode 100644 bf_sc/source/core/data/sc_dpsave.cxx create mode 100644 bf_sc/source/core/data/sc_dpshttab.cxx create mode 100644 bf_sc/source/core/data/sc_dptabdat.cxx create mode 100644 bf_sc/source/core/data/sc_dptabsrc.cxx create mode 100644 bf_sc/source/core/data/sc_drawpage.cxx create mode 100644 bf_sc/source/core/data/sc_drwlayer.cxx create mode 100644 bf_sc/source/core/data/sc_fillinfo.cxx create mode 100644 bf_sc/source/core/data/sc_global.cxx create mode 100644 bf_sc/source/core/data/sc_global2.cxx create mode 100644 bf_sc/source/core/data/sc_globalx.cxx create mode 100644 bf_sc/source/core/data/sc_markarr.cxx create mode 100644 bf_sc/source/core/data/sc_markdata.cxx create mode 100644 bf_sc/source/core/data/sc_olinetab.cxx create mode 100644 bf_sc/source/core/data/sc_pagepar.cxx create mode 100644 bf_sc/source/core/data/sc_patattr.cxx create mode 100644 bf_sc/source/core/data/sc_pivot.cxx create mode 100644 bf_sc/source/core/data/sc_pivot2.cxx create mode 100644 bf_sc/source/core/data/sc_poolhelp.cxx create mode 100644 bf_sc/source/core/data/sc_sortparam.cxx create mode 100644 bf_sc/source/core/data/sc_stlpool.cxx create mode 100644 bf_sc/source/core/data/sc_stlsheet.cxx create mode 100644 bf_sc/source/core/data/sc_table1.cxx create mode 100644 bf_sc/source/core/data/sc_table2.cxx create mode 100644 bf_sc/source/core/data/sc_table3.cxx create mode 100644 bf_sc/source/core/data/sc_table4.cxx create mode 100644 bf_sc/source/core/data/sc_table5.cxx create mode 100644 bf_sc/source/core/data/sc_userdat.cxx create mode 100644 bf_sc/source/core/data/sc_validat.cxx create mode 100644 bf_sc/source/core/inc/addinhelpid.hxx create mode 100644 bf_sc/source/core/inc/addinlis.hxx create mode 100644 bf_sc/source/core/inc/adiasync.hxx create mode 100644 bf_sc/source/core/inc/bcaslot.hxx create mode 100644 bf_sc/source/core/inc/ddelink.hxx create mode 100644 bf_sc/source/core/inc/interpre.hxx create mode 100644 bf_sc/source/core/inc/poolhelp.hxx create mode 100644 bf_sc/source/core/inc/refupdat.hxx create mode 100644 bf_sc/source/core/inc/scmatrix.hxx create mode 100644 bf_sc/source/core/inc/scrdata.hxx create mode 100644 bf_sc/source/core/src/makefile.mk create mode 100644 bf_sc/source/core/src/sc_compiler.src create mode 100644 bf_sc/source/core/tool/makefile.mk create mode 100644 bf_sc/source/core/tool/sc_addincol.cxx create mode 100644 bf_sc/source/core/tool/sc_addinhelpid.cxx create mode 100644 bf_sc/source/core/tool/sc_addinlis.cxx create mode 100644 bf_sc/source/core/tool/sc_adiasync.cxx create mode 100644 bf_sc/source/core/tool/sc_appoptio.cxx create mode 100644 bf_sc/source/core/tool/sc_autoform.cxx create mode 100644 bf_sc/source/core/tool/sc_callform.cxx create mode 100644 bf_sc/source/core/tool/sc_cellform.cxx create mode 100644 bf_sc/source/core/tool/sc_chartarr.cxx create mode 100644 bf_sc/source/core/tool/sc_chartlis.cxx create mode 100644 bf_sc/source/core/tool/sc_chgtrack.cxx create mode 100644 bf_sc/source/core/tool/sc_chgviset.cxx create mode 100644 bf_sc/source/core/tool/sc_collect.cxx create mode 100644 bf_sc/source/core/tool/sc_compiler.cxx create mode 100644 bf_sc/source/core/tool/sc_consoli.cxx create mode 100644 bf_sc/source/core/tool/sc_dbcolect.cxx create mode 100644 bf_sc/source/core/tool/sc_ddelink.cxx create mode 100644 bf_sc/source/core/tool/sc_detdata.cxx create mode 100644 bf_sc/source/core/tool/sc_detfunc.cxx create mode 100644 bf_sc/source/core/tool/sc_docoptio.cxx create mode 100644 bf_sc/source/core/tool/sc_editutil.cxx create mode 100644 bf_sc/source/core/tool/sc_hints.cxx create mode 100644 bf_sc/source/core/tool/sc_indexmap.cxx create mode 100644 bf_sc/source/core/tool/sc_inputopt.cxx create mode 100644 bf_sc/source/core/tool/sc_interpr1.cxx create mode 100644 bf_sc/source/core/tool/sc_interpr2.cxx create mode 100644 bf_sc/source/core/tool/sc_interpr3.cxx create mode 100644 bf_sc/source/core/tool/sc_interpr4.cxx create mode 100644 bf_sc/source/core/tool/sc_interpr5.cxx create mode 100644 bf_sc/source/core/tool/sc_interpr6.cxx create mode 100644 bf_sc/source/core/tool/sc_optutil.cxx create mode 100644 bf_sc/source/core/tool/sc_printopt.cxx create mode 100644 bf_sc/source/core/tool/sc_prnsave.cxx create mode 100644 bf_sc/source/core/tool/sc_progress.cxx create mode 100644 bf_sc/source/core/tool/sc_rangelst.cxx create mode 100644 bf_sc/source/core/tool/sc_rangenam.cxx create mode 100644 bf_sc/source/core/tool/sc_rangeseq.cxx create mode 100644 bf_sc/source/core/tool/sc_rangeutl.cxx create mode 100644 bf_sc/source/core/tool/sc_rechead.cxx create mode 100644 bf_sc/source/core/tool/sc_refdata.cxx create mode 100644 bf_sc/source/core/tool/sc_refreshtimer.cxx create mode 100644 bf_sc/source/core/tool/sc_refupdat.cxx create mode 100644 bf_sc/source/core/tool/sc_scmatrix.cxx create mode 100644 bf_sc/source/core/tool/sc_subtotal.cxx create mode 100644 bf_sc/source/core/tool/sc_token.cxx create mode 100644 bf_sc/source/core/tool/sc_unitconv.cxx create mode 100644 bf_sc/source/core/tool/sc_userlist.cxx create mode 100644 bf_sc/source/core/tool/sc_viewopti.cxx create mode 100644 bf_sc/source/core/tool/sc_zforauto.cxx create mode 100644 bf_sc/source/filter/xml/XMLCalculationSettingsContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLCellRangeSourceContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx create mode 100644 bf_sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx create mode 100644 bf_sc/source/filter/xml/XMLColumnRowGroupExport.hxx create mode 100644 bf_sc/source/filter/xml/XMLConsolidationContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLConverter.hxx create mode 100644 bf_sc/source/filter/xml/XMLDDELinksContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLDetectiveContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLEmptyContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLExportDDELinks.hxx create mode 100644 bf_sc/source/filter/xml/XMLExportDataPilot.hxx create mode 100644 bf_sc/source/filter/xml/XMLExportDatabaseRanges.hxx create mode 100644 bf_sc/source/filter/xml/XMLExportIterator.hxx create mode 100644 bf_sc/source/filter/xml/XMLExportSharedData.hxx create mode 100644 bf_sc/source/filter/xml/XMLStylesExportHelper.hxx create mode 100644 bf_sc/source/filter/xml/XMLStylesImportHelper.hxx create mode 100644 bf_sc/source/filter/xml/XMLTableHeaderFooterContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLTableMasterPageExport.hxx create mode 100644 bf_sc/source/filter/xml/XMLTableShapeImportHelper.hxx create mode 100644 bf_sc/source/filter/xml/XMLTableShapeResizer.hxx create mode 100644 bf_sc/source/filter/xml/XMLTableShapesContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLTableSourceContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLTextPContext.hxx create mode 100644 bf_sc/source/filter/xml/XMLTrackedChangesContext.hxx create mode 100644 bf_sc/source/filter/xml/makefile.mk create mode 100644 bf_sc/source/filter/xml/sc_XMLCalculationSettingsContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLCellRangeSourceContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLChangeTrackingExportHelper.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLChangeTrackingImportHelper.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLColumnRowGroupExport.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLConsolidationContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLConverter.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLDDELinksContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLDetectiveContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLEmptyContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLExportDDELinks.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLExportDataPilot.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLExportDatabaseRanges.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLExportIterator.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLExportSharedData.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLStylesExportHelper.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLStylesImportHelper.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTableHeaderFooterContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTableMasterPageExport.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTableShapeImportHelper.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTableShapeResizer.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTableShapesContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTableSourceContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTextPContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_XMLTrackedChangesContext.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlannoi.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlbodyi.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlcelli.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlcoli.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlconti.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlcvali.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmldpimp.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmldrani.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlexprt.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlfilti.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlfonte.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlimprt.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmllabri.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlnexpi.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlrowi.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlsceni.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlsorti.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlstyle.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlstyli.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmlsubti.cxx create mode 100644 bf_sc/source/filter/xml/sc_xmltabi.cxx create mode 100644 bf_sc/source/filter/xml/xmlannoi.hxx create mode 100644 bf_sc/source/filter/xml/xmlbodyi.hxx create mode 100644 bf_sc/source/filter/xml/xmlcelli.hxx create mode 100644 bf_sc/source/filter/xml/xmlcoli.hxx create mode 100644 bf_sc/source/filter/xml/xmlconti.hxx create mode 100644 bf_sc/source/filter/xml/xmlcvali.hxx create mode 100644 bf_sc/source/filter/xml/xmldpimp.hxx create mode 100644 bf_sc/source/filter/xml/xmldrani.hxx create mode 100644 bf_sc/source/filter/xml/xmlexprt.hxx create mode 100644 bf_sc/source/filter/xml/xmlfilti.hxx create mode 100644 bf_sc/source/filter/xml/xmlimprt.hxx create mode 100644 bf_sc/source/filter/xml/xmllabri.hxx create mode 100644 bf_sc/source/filter/xml/xmlnexpi.hxx create mode 100644 bf_sc/source/filter/xml/xmlrowi.hxx create mode 100644 bf_sc/source/filter/xml/xmlsceni.hxx create mode 100644 bf_sc/source/filter/xml/xmlsorti.hxx create mode 100644 bf_sc/source/filter/xml/xmlstyle.hxx create mode 100644 bf_sc/source/filter/xml/xmlstyli.hxx create mode 100644 bf_sc/source/filter/xml/xmlsubti.hxx create mode 100644 bf_sc/source/filter/xml/xmltabi.hxx create mode 100644 bf_sc/source/ui/app/makefile.mk create mode 100644 bf_sc/source/ui/app/sc_msgpool.cxx create mode 100644 bf_sc/source/ui/app/sc_rfindlst.cxx create mode 100644 bf_sc/source/ui/app/sc_scdll.cxx create mode 100644 bf_sc/source/ui/app/sc_sclib.cxx create mode 100644 bf_sc/source/ui/app/sc_scmod.cxx create mode 100644 bf_sc/source/ui/app/sc_scmod2.cxx create mode 100644 bf_sc/source/ui/app/sc_uiitems.cxx create mode 100644 bf_sc/source/ui/dbgui/asciiopt.hrc create mode 100644 bf_sc/source/ui/dbgui/imoptdlg.hrc create mode 100644 bf_sc/source/ui/dbgui/makefile.mk create mode 100644 bf_sc/source/ui/dbgui/pivot.hrc create mode 100644 bf_sc/source/ui/dbgui/sc_asciiopt.cxx create mode 100644 bf_sc/source/ui/dbgui/sc_asciiopt.src create mode 100644 bf_sc/source/ui/dbgui/sc_imoptdlg.cxx create mode 100644 bf_sc/source/ui/dbgui/sc_imoptdlg.src create mode 100644 bf_sc/source/ui/dbgui/sc_outline.src create mode 100644 bf_sc/source/ui/dbgui/sc_pivot.src create mode 100644 bf_sc/source/ui/docshell/makefile.mk create mode 100644 bf_sc/source/ui/docshell/sc_arealink.cxx create mode 100644 bf_sc/source/ui/docshell/sc_dbdocfun.cxx create mode 100644 bf_sc/source/ui/docshell/sc_dbdocimp.cxx create mode 100644 bf_sc/source/ui/docshell/sc_docfunc.cxx create mode 100644 bf_sc/source/ui/docshell/sc_docsh.cxx create mode 100644 bf_sc/source/ui/docshell/sc_docsh2.cxx create mode 100644 bf_sc/source/ui/docshell/sc_docsh3.cxx create mode 100644 bf_sc/source/ui/docshell/sc_docsh4.cxx create mode 100644 bf_sc/source/ui/docshell/sc_docsh5.cxx create mode 100644 bf_sc/source/ui/docshell/sc_docsh6.cxx create mode 100644 bf_sc/source/ui/docshell/sc_editable.cxx create mode 100644 bf_sc/source/ui/docshell/sc_impex.cxx create mode 100644 bf_sc/source/ui/docshell/sc_pntlock.cxx create mode 100644 bf_sc/source/ui/docshell/sc_sizedev.cxx create mode 100644 bf_sc/source/ui/docshell/sc_tablink.cxx create mode 100644 bf_sc/source/ui/inc/AccessibleContextBase.hxx create mode 100644 bf_sc/source/ui/inc/AccessibleText.hxx create mode 100644 bf_sc/source/ui/inc/asciiopt.hxx create mode 100644 bf_sc/source/ui/inc/autostyl.hxx create mode 100644 bf_sc/source/ui/inc/csvcontrol.hxx create mode 100644 bf_sc/source/ui/inc/csvgrid.hxx create mode 100644 bf_sc/source/ui/inc/csvruler.hxx create mode 100644 bf_sc/source/ui/inc/csvsplits.hxx create mode 100644 bf_sc/source/ui/inc/csvtablebox.hxx create mode 100644 bf_sc/source/ui/inc/dbdocfun.hxx create mode 100644 bf_sc/source/ui/inc/docfunc.hxx create mode 100644 bf_sc/source/ui/inc/docsh.hxx create mode 100644 bf_sc/source/ui/inc/editable.hxx create mode 100644 bf_sc/source/ui/inc/formdata.hxx create mode 100644 bf_sc/source/ui/inc/imoptdlg.hxx create mode 100644 bf_sc/source/ui/inc/impex.hxx create mode 100644 bf_sc/source/ui/inc/msgpool.hxx create mode 100644 bf_sc/source/ui/inc/namecrea.hxx create mode 100644 bf_sc/source/ui/inc/optload.hrc create mode 100644 bf_sc/source/ui/inc/pntlock.hxx create mode 100644 bf_sc/source/ui/inc/printfun.hxx create mode 100644 bf_sc/source/ui/inc/rfindlst.hxx create mode 100644 bf_sc/source/ui/inc/sizedev.hxx create mode 100644 bf_sc/source/ui/inc/teamdlg.hxx create mode 100644 bf_sc/source/ui/inc/tpcalc.hxx create mode 100644 bf_sc/source/ui/inc/tpusrlst.hxx create mode 100644 bf_sc/source/ui/inc/uiitems.hxx create mode 100644 bf_sc/source/ui/inc/undobase.hxx create mode 100644 bf_sc/source/ui/inc/undocell.hxx create mode 100644 bf_sc/source/ui/inc/undodat.hxx create mode 100644 bf_sc/source/ui/inc/undodraw.hxx create mode 100644 bf_sc/source/ui/inc/undotab.hxx create mode 100644 bf_sc/source/ui/inc/viewdata.hxx create mode 100644 bf_sc/source/ui/src/makefile.mk create mode 100644 bf_sc/source/ui/src/sc_globstr.src create mode 100644 bf_sc/source/ui/src/sc_pseudo.src create mode 100644 bf_sc/source/ui/src/sc_sc.src create mode 100644 bf_sc/source/ui/src/sc_scerrors.src create mode 100644 bf_sc/source/ui/src/sc_scstring.src create mode 100644 bf_sc/source/ui/unoobj/makefile.mk create mode 100644 bf_sc/source/ui/unoobj/sc_afmtuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_appluno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_cellsuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_chartuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_confuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_convuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_cursuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_dapiuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_datauno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_defltuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_docuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_drdefuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_editsrc.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_fielduno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_filtuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_fmtuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_forbiuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_funcuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_linkuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_miscuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_nameuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_notesuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_optuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_pageuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_servuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_shapeuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_styleuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_textuno.cxx create mode 100644 bf_sc/source/ui/unoobj/sc_unodoc.cxx create mode 100644 bf_sc/source/ui/view/makefile.mk create mode 100644 bf_sc/source/ui/view/sc_printfun.cxx create mode 100644 bf_sc/source/ui/view/sc_viewdata.cxx create mode 100644 bf_sc/util/bf_sc.component create mode 100644 bf_sc/util/bf_sc.map create mode 100644 bf_sc/util/makefile.mk create mode 100644 bf_sc/util/makefile.pmk create mode 100644 bf_sc/util/sc_hidother.src create mode 100644 bf_sc/util/verinfo.rc create mode 100644 bf_sch/source/core/makefile.mk create mode 100644 bf_sch/source/core/sch_ReBuildHint.cxx create mode 100644 bf_sch/source/core/sch_SchAddInCollection.cxx create mode 100644 bf_sch/source/core/sch_axisid.cxx create mode 100644 bf_sch/source/core/sch_axisobj.cxx create mode 100644 bf_sch/source/core/sch_calculat.cxx create mode 100644 bf_sch/source/core/sch_chartbar.cxx create mode 100644 bf_sch/source/core/sch_chartdoc.cxx create mode 100644 bf_sch/source/core/sch_charttyp.cxx create mode 100644 bf_sch/source/core/sch_chaxis.cxx create mode 100644 bf_sch/source/core/sch_chdescr.cxx create mode 100644 bf_sch/source/core/sch_chtm3d2.cxx create mode 100644 bf_sch/source/core/sch_chtmod2a.cxx create mode 100644 bf_sch/source/core/sch_chtmod3d.cxx create mode 100644 bf_sch/source/core/sch_chtmode1.cxx create mode 100644 bf_sch/source/core/sch_chtmode2.cxx create mode 100644 bf_sch/source/core/sch_chtmode3.cxx create mode 100644 bf_sch/source/core/sch_chtmode4.cxx create mode 100644 bf_sch/source/core/sch_chtmode5.cxx create mode 100644 bf_sch/source/core/sch_chtmode6.cxx create mode 100644 bf_sch/source/core/sch_chtmode7.cxx create mode 100644 bf_sch/source/core/sch_chtmode8.cxx create mode 100644 bf_sch/source/core/sch_chtmode9.cxx create mode 100644 bf_sch/source/core/sch_chtmodel.cxx create mode 100644 bf_sch/source/core/sch_chtscene.cxx create mode 100644 bf_sch/source/core/sch_datapoin.cxx create mode 100644 bf_sch/source/core/sch_datarow.cxx create mode 100644 bf_sch/source/core/sch_glob.src create mode 100644 bf_sch/source/core/sch_globfunc.cxx create mode 100644 bf_sch/source/core/sch_itempool.cxx create mode 100644 bf_sch/source/core/sch_memchrt.cxx create mode 100644 bf_sch/source/core/sch_objadj.cxx create mode 100644 bf_sch/source/core/sch_objfac.cxx create mode 100644 bf_sch/source/core/sch_objid.cxx create mode 100644 bf_sch/source/core/sch_schgroup.cxx create mode 100644 bf_sch/source/core/sch_schiocmp.cxx create mode 100644 bf_sch/source/core/sch_stlpool.cxx create mode 100644 bf_sch/source/core/sch_stlsheet.cxx create mode 100644 bf_sch/source/filter/xml/makefile.mk create mode 100644 bf_sch/source/filter/xml/sch_SchXMLWrapper.cxx create mode 100644 bf_sch/source/makefile.mk create mode 100644 bf_sch/source/ui/app/makefile.mk create mode 100644 bf_sch/source/ui/app/sch_app.src create mode 100644 bf_sch/source/ui/app/sch_globopt.cxx create mode 100644 bf_sch/source/ui/app/sch_menuids.src create mode 100644 bf_sch/source/ui/app/sch_schdll.cxx create mode 100644 bf_sch/source/ui/app/sch_schlib.cxx create mode 100644 bf_sch/source/ui/app/sch_schmod.cxx create mode 100644 bf_sch/source/ui/app/sch_schopt.cxx create mode 100644 bf_sch/source/ui/app/sch_schresid.cxx create mode 100644 bf_sch/source/ui/app/sch_strings.src create mode 100644 bf_sch/source/ui/app/sch_typemap.cxx create mode 100644 bf_sch/source/ui/docshell/makefile.mk create mode 100644 bf_sch/source/ui/docshell/sch_docshel1.cxx create mode 100644 bf_sch/source/ui/docshell/sch_docshell.cxx create mode 100644 bf_sch/source/ui/inc/ChXChartData.hxx create mode 100644 bf_sch/source/ui/inc/ChXChartDataChangeEventListener.hxx create mode 100644 bf_sch/source/ui/inc/ChXChartDrawPage.hxx create mode 100644 bf_sch/source/ui/inc/ChXChartObject.hxx create mode 100644 bf_sch/source/ui/inc/ChXDataPoint.hxx create mode 100644 bf_sch/source/ui/inc/ChXDataRow.hxx create mode 100644 bf_sch/source/ui/inc/ChXDiagram.hxx create mode 100644 bf_sch/source/ui/inc/ChartArea.hxx create mode 100644 bf_sch/source/ui/inc/ChartGrid.hxx create mode 100644 bf_sch/source/ui/inc/ChartLegend.hxx create mode 100644 bf_sch/source/ui/inc/ChartLine.hxx create mode 100644 bf_sch/source/ui/inc/ChartTitle.hxx create mode 100644 bf_sch/source/ui/inc/SchTransferable.hxx create mode 100644 bf_sch/source/ui/inc/dlgctrls.hxx create mode 100644 bf_sch/source/ui/inc/globopt.hxx create mode 100644 bf_sch/source/ui/inc/guiutil.hxx create mode 100644 bf_sch/source/ui/inc/res_bmp.hrc create mode 100644 bf_sch/source/ui/inc/res_hc_bmp.hrc create mode 100644 bf_sch/source/ui/inc/schhids.h create mode 100644 bf_sch/source/ui/inc/sdvcbrw.hxx create mode 100644 bf_sch/source/ui/inc/tbx_ww.hxx create mode 100644 bf_sch/source/ui/unoidl/descr/ChXChartAxis.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChXChartData.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChXChartDataArray.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChXChartDocument.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChXChartView.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChXDataPoint.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChXDataRow.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChXDiagram.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChartArea.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChartGrid.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChartLegend.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChartLine.xml create mode 100644 bf_sch/source/ui/unoidl/descr/ChartTitle.xml create mode 100644 bf_sch/source/ui/unoidl/makefile.mk create mode 100644 bf_sch/source/ui/unoidl/sch_ChXChartAxis.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXChartData.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXChartDataChangeEventListener.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXChartDocument.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXChartDrawPage.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXChartObject.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXDataPoint.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXDataRow.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChXDiagram.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChartArea.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChartGrid.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChartLegend.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChartLine.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_ChartTitle.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_mapprov.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_register.cxx create mode 100644 bf_sch/source/ui/unoidl/sch_unodoc.cxx create mode 100644 bf_sch/util/bf_sch.component create mode 100644 bf_sch/util/bf_sch.map create mode 100644 bf_sch/util/makefile.mk create mode 100644 bf_sch/util/sch_hidother.src create mode 100644 bf_sch/util/sch_sch.cxx create mode 100644 bf_sch/util/verinfo.rc create mode 100644 bf_sd/source/core/makefile.mk create mode 100644 bf_sd/source/core/sd_anminfo.cxx create mode 100644 bf_sd/source/core/sd_cusshow.cxx create mode 100644 bf_sd/source/core/sd_drawdoc.cxx create mode 100644 bf_sd/source/core/sd_drawdoc2.cxx create mode 100644 bf_sd/source/core/sd_drawdoc3.cxx create mode 100644 bf_sd/source/core/sd_drawdoc4.cxx create mode 100644 bf_sd/source/core/sd_glob.src create mode 100644 bf_sd/source/core/sd_sdattr.cxx create mode 100644 bf_sd/source/core/sd_sdiocmpt.cxx create mode 100644 bf_sd/source/core/sd_sdobjfac.cxx create mode 100644 bf_sd/source/core/sd_sdpage.cxx create mode 100644 bf_sd/source/core/sd_sdpage2.cxx create mode 100644 bf_sd/source/core/sd_stlpool.cxx create mode 100644 bf_sd/source/core/sd_stlsheet.cxx create mode 100644 bf_sd/source/filter/bin/makefile.mk create mode 100644 bf_sd/source/filter/bin/sd_sdbinfilter.cxx create mode 100644 bf_sd/source/filter/makefile.mk create mode 100644 bf_sd/source/filter/propread.hxx create mode 100644 bf_sd/source/filter/sd_propread.cxx create mode 100644 bf_sd/source/filter/sd_sdfilter.cxx create mode 100644 bf_sd/source/filter/xml/makefile.mk create mode 100644 bf_sd/source/filter/xml/sd_sdxmlwrp.cxx create mode 100644 bf_sd/source/ui/app/makefile.mk create mode 100644 bf_sd/source/ui/app/sd_optsitem.cxx create mode 100644 bf_sd/source/ui/app/sd_sddll.cxx create mode 100644 bf_sd/source/ui/app/sd_sdlib.cxx create mode 100644 bf_sd/source/ui/app/sd_sdmod.cxx create mode 100644 bf_sd/source/ui/app/sd_sdresid.cxx create mode 100644 bf_sd/source/ui/app/sd_strings.src create mode 100644 bf_sd/source/ui/docshell/makefile.mk create mode 100644 bf_sd/source/ui/docshell/sd_docshell.cxx create mode 100644 bf_sd/source/ui/docshell/sd_grdocsh.cxx create mode 100644 bf_sd/source/ui/inc/cfgids.hxx create mode 100644 bf_sd/source/ui/inc/optsitem.hxx create mode 100644 bf_sd/source/ui/inc/prlayout.hxx create mode 100644 bf_sd/source/ui/inc/strings.hrc create mode 100644 bf_sd/source/ui/inc/unokywds.hxx create mode 100644 bf_sd/source/ui/inc/unomodel.hxx create mode 100644 bf_sd/source/ui/inc/unoprnms.hxx create mode 100644 bf_sd/source/ui/unoidl/UnoDocumentSettings.hxx create mode 100644 bf_sd/source/ui/unoidl/makefile.mk create mode 100644 bf_sd/source/ui/unoidl/sd_UnoDocumentSettings.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_facreg.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unocpres.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unodoc.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unogsfm.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unogstyl.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unokywds.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unolayer.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unomodel.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unoobj.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unopage.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unopback.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unopool.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unopres.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unopsfm.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unopstyl.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unostyls.cxx create mode 100644 bf_sd/source/ui/unoidl/sd_unowcntr.cxx create mode 100644 bf_sd/source/ui/unoidl/unocpres.hxx create mode 100644 bf_sd/source/ui/unoidl/unogsfm.hxx create mode 100644 bf_sd/source/ui/unoidl/unogstyl.hxx create mode 100644 bf_sd/source/ui/unoidl/unohelp.hxx create mode 100644 bf_sd/source/ui/unoidl/unolayer.hxx create mode 100644 bf_sd/source/ui/unoidl/unoobj.hxx create mode 100644 bf_sd/source/ui/unoidl/unopage.hxx create mode 100644 bf_sd/source/ui/unoidl/unopback.hxx create mode 100644 bf_sd/source/ui/unoidl/unopres.hxx create mode 100644 bf_sd/source/ui/unoidl/unopsfm.hxx create mode 100644 bf_sd/source/ui/unoidl/unopstyl.hxx create mode 100644 bf_sd/source/ui/unoidl/unostyls.hxx create mode 100644 bf_sd/source/ui/unoidl/unowcntr.hxx create mode 100644 bf_sd/source/ui/view/makefile.mk create mode 100644 bf_sd/source/ui/view/sd_frmview.cxx create mode 100644 bf_sd/source/ui/view/sd_sdoutl.cxx create mode 100644 bf_sd/util/bf_sd.component create mode 100644 bf_sd/util/bf_sd.map create mode 100644 bf_sd/util/exports.dxp create mode 100644 bf_sd/util/hidother.hrc create mode 100644 bf_sd/util/makefile.mk create mode 100644 bf_sd/util/makefile.pmk create mode 100644 bf_sd/util/sd_hidother.src create mode 100644 bf_sd/util/sd_sd.cxx create mode 100644 bf_sd/util/split_rc.awk create mode 100644 bf_sd/util/verinfo.rc create mode 100644 bf_sfx2/source/appl/appimp.hxx create mode 100644 bf_sfx2/source/appl/imestatuswindow.hxx create mode 100644 bf_sfx2/source/appl/makefile.mk create mode 100644 bf_sfx2/source/appl/sfx2_app.cxx create mode 100644 bf_sfx2/source/appl/sfx2_app.src create mode 100644 bf_sfx2/source/appl/sfx2_appbas.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appcfg.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appdata.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appinit.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appmain.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appmisc.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appopen.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appquit.cxx create mode 100644 bf_sfx2/source/appl/sfx2_appuno.cxx create mode 100644 bf_sfx2/source/appl/sfx2_dlgcont.cxx create mode 100644 bf_sfx2/source/appl/sfx2_imestatuswindow.cxx create mode 100644 bf_sfx2/source/appl/sfx2_minbox.src create mode 100644 bf_sfx2/source/appl/sfx2_module.cxx create mode 100644 bf_sfx2/source/appl/sfx2_namecont.cxx create mode 100644 bf_sfx2/source/appl/sfx2_scriptcont.cxx create mode 100644 bf_sfx2/source/appl/sfx2_sfx.src create mode 100644 bf_sfx2/source/appl/sfx2_sfxdll.cxx create mode 100644 bf_sfx2/source/bastyp/etcp.h create mode 100644 bf_sfx2/source/bastyp/fltlst.hxx create mode 100644 bf_sfx2/source/bastyp/l2s.hxx create mode 100644 bf_sfx2/source/bastyp/makefile.mk create mode 100644 bf_sfx2/source/bastyp/sfx2_bitset.cxx create mode 100644 bf_sfx2/source/bastyp/sfx2_fltfnc.cxx create mode 100644 bf_sfx2/source/bastyp/sfx2_fltlst.cxx create mode 100644 bf_sfx2/source/bastyp/sfx2_minarray.cxx create mode 100644 bf_sfx2/source/bastyp/sfx2_misc.cxx create mode 100644 bf_sfx2/source/bastyp/sfx2_progress.cxx create mode 100644 bf_sfx2/source/config/cfgimpl.hxx create mode 100644 bf_sfx2/source/config/makefile.mk create mode 100644 bf_sfx2/source/config/sfx2_cfgitem.cxx create mode 100644 bf_sfx2/source/config/sfx2_cfgmgr.cxx create mode 100644 bf_sfx2/source/config/sfx2_evntconf.cxx create mode 100644 bf_sfx2/source/config/sfx2_misccfg.cxx create mode 100644 bf_sfx2/source/control/makefile.mk create mode 100644 bf_sfx2/source/control/sfx2_macrconf.cxx create mode 100644 bf_sfx2/source/control/sfx2_request.cxx create mode 100644 bf_sfx2/source/control/sfx2_shell.cxx create mode 100644 bf_sfx2/source/control/sfx2_srchitem.cxx create mode 100644 bf_sfx2/source/doc/makefile.mk create mode 100644 bf_sfx2/source/doc/sfx2_dinfobj.cxx create mode 100644 bf_sfx2/source/doc/sfx2_docfac.cxx create mode 100644 bf_sfx2/source/doc/sfx2_docfile.cxx create mode 100644 bf_sfx2/source/doc/sfx2_docfilt.cxx create mode 100644 bf_sfx2/source/doc/sfx2_docinf.cxx create mode 100644 bf_sfx2/source/doc/sfx2_frameobj.cxx create mode 100644 bf_sfx2/source/doc/sfx2_frmdescr.cxx create mode 100644 bf_sfx2/source/doc/sfx2_interno.cxx create mode 100644 bf_sfx2/source/doc/sfx2_objcont.cxx create mode 100644 bf_sfx2/source/doc/sfx2_objitem.cxx create mode 100644 bf_sfx2/source/doc/sfx2_objmisc.cxx create mode 100644 bf_sfx2/source/doc/sfx2_objserv.cxx create mode 100644 bf_sfx2/source/doc/sfx2_objstor.cxx create mode 100644 bf_sfx2/source/doc/sfx2_objuno.cxx create mode 100644 bf_sfx2/source/doc/sfx2_objxtor.cxx create mode 100644 bf_sfx2/source/doc/sfx2_plugobj.cxx create mode 100644 bf_sfx2/source/doc/sfx2_sfxbasemodel.cxx create mode 100644 bf_sfx2/source/doc/sfx2_xmlversion.cxx create mode 100644 bf_sfx2/source/doc/timestamp.cxx create mode 100644 bf_sfx2/source/doc/xmlversion.hxx create mode 100644 bf_sfx2/source/explorer/makefile.mk create mode 100644 bf_sfx2/source/explorer/sfx2_nochaos.cxx create mode 100644 bf_sfx2/source/inc/appbas.hxx create mode 100644 bf_sfx2/source/inc/appdata.hxx create mode 100644 bf_sfx2/source/inc/cfgmgr.hxx create mode 100644 bf_sfx2/source/inc/conttrans.hxx create mode 100644 bf_sfx2/source/inc/dinfobj.hxx create mode 100644 bf_sfx2/source/inc/dlgcont.hxx create mode 100644 bf_sfx2/source/inc/doctemplates.hxx create mode 100644 bf_sfx2/source/inc/eventsupplier.hxx create mode 100644 bf_sfx2/source/inc/fltfnc.hxx create mode 100644 bf_sfx2/source/inc/fltoptint.hxx create mode 100644 bf_sfx2/source/inc/helper.hxx create mode 100644 bf_sfx2/source/inc/namecont.hxx create mode 100644 bf_sfx2/source/inc/nochaos.hxx create mode 100644 bf_sfx2/source/inc/objshimp.hxx create mode 100644 bf_sfx2/source/inc/openflag.hxx create mode 100644 bf_sfx2/source/inc/referers.hxx create mode 100644 bf_sfx2/source/inc/scriptcont.hxx create mode 100644 bf_sfx2/source/inc/sfxtypes.hxx create mode 100644 bf_sfx2/source/inc/tplcomp.hxx create mode 100644 bf_sfx2/source/notify/makefile.mk create mode 100644 bf_sfx2/source/notify/sfx2_eventsupplier.cxx create mode 100644 bf_sfx2/source/notify/sfx2_hintpost.cxx create mode 100644 bf_sfx2/source/view/makefile.mk create mode 100644 bf_sfx2/source/view/sfx2_printer.cxx create mode 100644 bf_sfx2/util/make_tco.btm create mode 100644 bf_sfx2/util/makefile.mk create mode 100644 bf_sfx2/util/makefile.prj create mode 100644 bf_sfx2/util/sfx.xml create mode 100644 bf_so3/inc/binddata.hxx create mode 100644 bf_so3/inc/insdlg.hxx create mode 100644 bf_so3/inc/soimpl.hxx create mode 100644 bf_so3/inc/svuidlg.hrc create mode 100644 bf_so3/source/copied/makefile.mk create mode 100644 bf_so3/source/copied/staticbaseurl.cxx create mode 100644 bf_so3/source/data/makefile.mk create mode 100644 bf_so3/source/data/pseudo.cxx create mode 100644 bf_so3/source/dialog/insdlg.cxx create mode 100644 bf_so3/source/dialog/ipwin.cxx create mode 100644 bf_so3/source/dialog/makefile.mk create mode 100644 bf_so3/source/dialog/plfilter.cxx create mode 100644 bf_so3/source/inplace/applet2.cxx create mode 100644 bf_so3/source/inplace/client.cxx create mode 100644 bf_so3/source/inplace/embobj.cxx create mode 100644 bf_so3/source/inplace/ipclient.cxx create mode 100644 bf_so3/source/inplace/ipenv.cxx create mode 100644 bf_so3/source/inplace/ipobj.cxx create mode 100644 bf_so3/source/inplace/makefile.mk create mode 100644 bf_so3/source/inplace/outplace.cxx create mode 100644 bf_so3/source/inplace/plugin.cxx create mode 100644 bf_so3/source/inplace/protocol.cxx create mode 100644 bf_so3/source/inplace/rmapplet.cxx create mode 100644 bf_so3/source/inplace/soconv.cxx create mode 100644 bf_so3/source/inplace/viscache.hxx create mode 100644 bf_so3/source/misc/factory.cxx create mode 100644 bf_so3/source/misc/iface.cxx create mode 100644 bf_so3/source/misc/makefile.mk create mode 100644 bf_so3/source/misc/so2dll.cxx create mode 100644 bf_so3/source/ole/ansi.cxx create mode 100644 bf_so3/source/ole/helpers.cxx create mode 100644 bf_so3/source/ole/makefile.mk create mode 100644 bf_so3/source/ole/socli.cxx create mode 100644 bf_so3/source/ole/socont.cxx create mode 100644 bf_so3/source/ole/socont.h create mode 100644 bf_so3/source/ole/soole.h create mode 100644 bf_so3/source/ole/sosink.cxx create mode 100644 bf_so3/source/ole/uieffect.cxx create mode 100644 bf_so3/source/persist/binddata.cxx create mode 100644 bf_so3/source/persist/makefile.mk create mode 100644 bf_so3/source/persist/persist.cxx create mode 100644 bf_so3/source/persist/svstor.cxx create mode 100644 bf_so3/source/persist/transbnd.cxx create mode 100644 bf_so3/source/persist/transprt.cxx create mode 100644 bf_so3/source/persist/transuno.cxx create mode 100644 bf_so3/source/persist/transuno.hxx create mode 100644 bf_so3/source/solink/impldde.cxx create mode 100644 bf_so3/source/solink/impldde.hxx create mode 100644 bf_so3/source/solink/linkmgr2.cxx create mode 100644 bf_so3/source/solink/linksrc.cxx create mode 100644 bf_so3/source/solink/lnkbase2.cxx create mode 100644 bf_so3/source/solink/makefile.mk create mode 100644 bf_so3/src/makefile.mk create mode 100644 bf_so3/src/nocode.src create mode 100644 bf_so3/util/makefile.mk create mode 100644 bf_so3/util/makefile.pmk create mode 100644 bf_starmath/source/cfgitem.hxx create mode 100644 bf_starmath/source/makefile.mk create mode 100644 bf_starmath/source/mathml.hxx create mode 100644 bf_starmath/source/starmath_cfgitem.cxx create mode 100644 bf_starmath/source/starmath_command.cxx create mode 100644 bf_starmath/source/starmath_commands.src create mode 100644 bf_starmath/source/starmath_config.cxx create mode 100644 bf_starmath/source/starmath_document.cxx create mode 100644 bf_starmath/source/starmath_format.cxx create mode 100644 bf_starmath/source/starmath_mathml.cxx create mode 100644 bf_starmath/source/starmath_node.cxx create mode 100644 bf_starmath/source/starmath_parse.cxx create mode 100644 bf_starmath/source/starmath_rect.cxx create mode 100644 bf_starmath/source/starmath_register.cxx create mode 100644 bf_starmath/source/starmath_smdll.cxx create mode 100644 bf_starmath/source/starmath_smlib.cxx create mode 100644 bf_starmath/source/starmath_smmod.cxx create mode 100644 bf_starmath/source/starmath_smres.src create mode 100644 bf_starmath/source/starmath_symbol.cxx create mode 100644 bf_starmath/source/starmath_symbol.src create mode 100644 bf_starmath/source/starmath_typemap.cxx create mode 100644 bf_starmath/source/starmath_unodoc.cxx create mode 100644 bf_starmath/source/starmath_unomodel.cxx create mode 100644 bf_starmath/source/starmath_utility.cxx create mode 100644 bf_starmath/util/bf_sm.component create mode 100644 bf_starmath/util/bf_sm.map create mode 100644 bf_starmath/util/makefile.mk create mode 100644 bf_starmath/util/makefile.pmk create mode 100644 bf_starmath/util/starmath_hidother.src create mode 100644 bf_svtools/source/config/itemholder1.hxx create mode 100644 bf_svtools/source/config/itemholder2.hxx create mode 100644 bf_svtools/source/config/itemholderbase.hxx create mode 100644 bf_svtools/source/config/makefile.mk create mode 100644 bf_svtools/source/config/svt_addxmltostorageoptions.cxx create mode 100644 bf_svtools/source/config/svt_cacheoptions.cxx create mode 100644 bf_svtools/source/config/svt_cjkoptions.cxx create mode 100644 bf_svtools/source/config/svt_cmdoptions.cxx create mode 100644 bf_svtools/source/config/svt_colorcfg.cxx create mode 100644 bf_svtools/source/config/svt_compatibility.cxx create mode 100644 bf_svtools/source/config/svt_ctloptions.cxx create mode 100644 bf_svtools/source/config/svt_defaultoptions.cxx create mode 100644 bf_svtools/source/config/svt_dynamicmenuoptions.cxx create mode 100644 bf_svtools/source/config/svt_extendedsecurityoptions.cxx create mode 100644 bf_svtools/source/config/svt_fontoptions.cxx create mode 100644 bf_svtools/source/config/svt_helpopt.cxx create mode 100644 bf_svtools/source/config/svt_historyoptions.cxx create mode 100644 bf_svtools/source/config/svt_inetoptions.cxx create mode 100644 bf_svtools/source/config/svt_internaloptions.cxx create mode 100644 bf_svtools/source/config/svt_itemholder1.cxx create mode 100644 bf_svtools/source/config/svt_itemholder2.cxx create mode 100644 bf_svtools/source/config/svt_languageoptions.cxx create mode 100644 bf_svtools/source/config/svt_lingucfg.cxx create mode 100644 bf_svtools/source/config/svt_localisationoptions.cxx create mode 100644 bf_svtools/source/config/svt_menuoptions.cxx create mode 100644 bf_svtools/source/config/svt_misccfg.cxx create mode 100644 bf_svtools/source/config/svt_miscopt.cxx create mode 100644 bf_svtools/source/config/svt_moduleoptions.cxx create mode 100644 bf_svtools/source/config/svt_options.cxx create mode 100644 bf_svtools/source/config/svt_options3d.cxx create mode 100644 bf_svtools/source/config/svt_optionsdlg.cxx create mode 100644 bf_svtools/source/config/svt_pathoptions.cxx create mode 100644 bf_svtools/source/config/svt_printoptions.cxx create mode 100644 bf_svtools/source/config/svt_printwarningoptions.cxx create mode 100644 bf_svtools/source/config/svt_saveopt.cxx create mode 100644 bf_svtools/source/config/svt_searchopt.cxx create mode 100644 bf_svtools/source/config/svt_securityoptions.cxx create mode 100644 bf_svtools/source/config/svt_sourceviewconfig.cxx create mode 100644 bf_svtools/source/config/svt_startoptions.cxx create mode 100644 bf_svtools/source/config/svt_syslocaleoptions.cxx create mode 100644 bf_svtools/source/config/svt_undoopt.cxx create mode 100644 bf_svtools/source/config/svt_useroptions.cxx create mode 100644 bf_svtools/source/config/svt_viewoptions.cxx create mode 100644 bf_svtools/source/config/svt_workingsetoptions.cxx create mode 100644 bf_svtools/source/filerec/makefile.mk create mode 100644 bf_svtools/source/filerec/svt_filerec.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/FilterConfigCache.hxx create mode 100644 bf_svtools/source/filter.vcl/filter/makefile.mk create mode 100644 bf_svtools/source/filter.vcl/filter/sgf.ini create mode 100644 bf_svtools/source/filter.vcl/filter/svt_FilterConfigCache.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_filter.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_filter2.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_fldll.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_sgfbram.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_sgvmain.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_sgvspln.cxx create mode 100644 bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx create mode 100644 bf_svtools/source/filter.vcl/igif/decode.hxx create mode 100644 bf_svtools/source/filter.vcl/igif/makefile.mk create mode 100644 bf_svtools/source/filter.vcl/igif/svt_decode.cxx create mode 100644 bf_svtools/source/filter.vcl/igif/svt_gifread.cxx create mode 100644 bf_svtools/source/filter.vcl/ixbm/makefile.mk create mode 100644 bf_svtools/source/filter.vcl/ixbm/svt_xbmread.cxx create mode 100644 bf_svtools/source/filter.vcl/ixpm/makefile.mk create mode 100644 bf_svtools/source/filter.vcl/ixpm/rgbtable.hxx create mode 100644 bf_svtools/source/filter.vcl/ixpm/svt_xpmread.cxx create mode 100644 bf_svtools/source/filter.vcl/jpeg/jpeg.h create mode 100644 bf_svtools/source/filter.vcl/jpeg/makefile.mk create mode 100644 bf_svtools/source/filter.vcl/jpeg/svt_jpeg.cxx create mode 100644 bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c create mode 100644 bf_svtools/source/filter.vcl/wmf/emfwr.hxx create mode 100644 bf_svtools/source/filter.vcl/wmf/makefile.mk create mode 100644 bf_svtools/source/filter.vcl/wmf/svt_emfwr.cxx create mode 100644 bf_svtools/source/filter.vcl/wmf/svt_enhwmf.cxx create mode 100644 bf_svtools/source/filter.vcl/wmf/svt_winmtf.cxx create mode 100644 bf_svtools/source/filter.vcl/wmf/svt_winwmf.cxx create mode 100644 bf_svtools/source/filter.vcl/wmf/svt_wmf.cxx create mode 100644 bf_svtools/source/filter.vcl/wmf/svt_wmfwr.cxx create mode 100644 bf_svtools/source/filter.vcl/wmf/winmtf.hxx create mode 100644 bf_svtools/source/filter.vcl/wmf/wmfwr.hxx create mode 100644 bf_svtools/source/inc/fsfactory.hxx create mode 100644 bf_svtools/source/inc/poolio.hxx create mode 100644 bf_svtools/source/items/makefile.mk create mode 100644 bf_svtools/source/items/svt_aeitem.cxx create mode 100644 bf_svtools/source/items/svt_eitem.cxx create mode 100644 bf_svtools/source/items/svt_flagitem.cxx create mode 100644 bf_svtools/source/items/svt_globalnameitem.cxx create mode 100644 bf_svtools/source/items/svt_intitem.cxx create mode 100644 bf_svtools/source/items/svt_macitem.cxx create mode 100644 bf_svtools/source/items/svt_poolcach.cxx create mode 100644 bf_svtools/source/items/svt_ptitem.cxx create mode 100644 bf_svtools/source/items/svt_rectitem.cxx create mode 100644 bf_svtools/source/items/svt_rngitem.cxx create mode 100644 bf_svtools/source/items/svt_rngitem_inc.cxx create mode 100644 bf_svtools/source/items/svt_stritem.cxx create mode 100644 bf_svtools/source/items/svt_style.cxx create mode 100644 bf_svtools/source/items/svt_szitem.cxx create mode 100644 bf_svtools/source/items1/makefile.mk create mode 100644 bf_svtools/source/items1/svt_bintitem.cxx create mode 100644 bf_svtools/source/items1/svt_cenumitm.cxx create mode 100644 bf_svtools/source/items1/svt_cintitem.cxx create mode 100644 bf_svtools/source/items1/svt_cntwall.cxx create mode 100644 bf_svtools/source/items1/svt_cstitem.cxx create mode 100644 bf_svtools/source/items1/svt_ctypeitm.cxx create mode 100644 bf_svtools/source/items1/svt_custritm.cxx create mode 100644 bf_svtools/source/items1/svt_dateitem.cxx create mode 100644 bf_svtools/source/items1/svt_dtritem.cxx create mode 100644 bf_svtools/source/items1/svt_frqitem.cxx create mode 100644 bf_svtools/source/items1/svt_ilstitem.cxx create mode 100644 bf_svtools/source/items1/svt_itemiter.cxx create mode 100644 bf_svtools/source/items1/svt_itempool.cxx create mode 100644 bf_svtools/source/items1/svt_itemprop.cxx create mode 100644 bf_svtools/source/items1/svt_itemset.cxx create mode 100644 bf_svtools/source/items1/svt_lckbitem.cxx create mode 100644 bf_svtools/source/items1/svt_nranges.cxx create mode 100644 bf_svtools/source/items1/svt_poolio.cxx create mode 100644 bf_svtools/source/items1/svt_poolitem.cxx create mode 100644 bf_svtools/source/items1/svt_sfontitm.cxx create mode 100644 bf_svtools/source/items1/svt_sitem.cxx create mode 100644 bf_svtools/source/items1/svt_slstitm.cxx create mode 100644 bf_svtools/source/items1/svt_stylepool.cxx create mode 100644 bf_svtools/source/items1/svt_tfrmitem.cxx create mode 100644 bf_svtools/source/items1/svt_tresitem.cxx create mode 100644 bf_svtools/source/items1/svt_visitem.cxx create mode 100644 bf_svtools/source/items1/svt_whiter.cxx create mode 100644 bf_svtools/source/items1/whassert.hxx create mode 100644 bf_svtools/source/memtools/makefile.mk create mode 100644 bf_svtools/source/memtools/svt_svarray.cxx create mode 100644 bf_svtools/source/memtools/tl_contnr.cxx create mode 100644 bf_svtools/source/memtools/tl_unqidx.cxx create mode 100644 bf_svtools/source/misc/ctrltool.src create mode 100644 bf_svtools/source/misc/errtxt.src create mode 100644 bf_svtools/source/misc/makefile.mk create mode 100644 bf_svtools/source/misc/svt_asynclink.cxx create mode 100644 bf_svtools/source/misc/svt_ctrltool.cxx create mode 100644 bf_svtools/source/misc/svt_ehdl.cxx create mode 100644 bf_svtools/source/misc/svt_flbytes.cxx create mode 100644 bf_svtools/source/misc/svt_imageresourceaccess.cxx create mode 100644 bf_svtools/source/misc/svt_imap.cxx create mode 100644 bf_svtools/source/misc/svt_imap2.cxx create mode 100644 bf_svtools/source/misc/svt_imap3.cxx create mode 100644 bf_svtools/source/misc/svt_ownlist.cxx create mode 100644 bf_svtools/source/misc/svt_restrictedpaths.cxx create mode 100644 bf_svtools/source/misc/svt_templatefoldercache.cxx create mode 100644 bf_svtools/source/misc/svt_urihelper.cxx create mode 100644 bf_svtools/source/misc/svt_vcldata.cxx create mode 100644 bf_svtools/source/misc/tl_tstring.cxx create mode 100644 bf_svtools/source/misc1/makefile.mk create mode 100644 bf_svtools/source/misc1/svt_PasswordHelper.cxx create mode 100644 bf_svtools/source/misc1/svt_adrparse.cxx create mode 100644 bf_svtools/source/misc1/svt_docpasswdrequest.cxx create mode 100644 bf_svtools/source/misc1/svt_fstathelper.cxx create mode 100644 bf_svtools/source/misc1/svt_inethist.cxx create mode 100644 bf_svtools/source/misc1/svt_inettype.cxx create mode 100644 bf_svtools/source/misc1/svt_loginerr.cxx create mode 100644 bf_svtools/source/misc1/svt_strmadpt.cxx create mode 100644 bf_svtools/source/misc1/svt_svtdata.cxx create mode 100644 bf_svtools/source/notify/listenerbase.hxx create mode 100644 bf_svtools/source/notify/makefile.mk create mode 100644 bf_svtools/source/notify/svt_brdcst.cxx create mode 100644 bf_svtools/source/notify/svt_broadcast.cxx create mode 100644 bf_svtools/source/notify/svt_cancel.cxx create mode 100644 bf_svtools/source/notify/svt_hint.cxx create mode 100644 bf_svtools/source/notify/svt_isethint.cxx create mode 100644 bf_svtools/source/notify/svt_listener.cxx create mode 100644 bf_svtools/source/notify/svt_listenerbase.cxx create mode 100644 bf_svtools/source/notify/svt_listeneriter.cxx create mode 100644 bf_svtools/source/notify/svt_lstner.cxx create mode 100644 bf_svtools/source/notify/svt_smplhint.cxx create mode 100644 bf_svtools/source/numbers/makefile.mk create mode 100644 bf_svtools/source/numbers/numfmuno.hxx create mode 100644 bf_svtools/source/numbers/numhead.hxx create mode 100644 bf_svtools/source/numbers/supservs.hxx create mode 100644 bf_svtools/source/numbers/svt_nbdll.cxx create mode 100644 bf_svtools/source/numbers/svt_numfmuno.cxx create mode 100644 bf_svtools/source/numbers/svt_numhead.cxx create mode 100644 bf_svtools/source/numbers/svt_numuno.cxx create mode 100644 bf_svtools/source/numbers/svt_supservs.cxx create mode 100644 bf_svtools/source/numbers/svt_zforfind.cxx create mode 100644 bf_svtools/source/numbers/svt_zforlist.cxx create mode 100644 bf_svtools/source/numbers/svt_zformat.cxx create mode 100644 bf_svtools/source/numbers/svt_zforscan.cxx create mode 100644 bf_svtools/source/numbers/zforscan.hxx create mode 100644 bf_svtools/source/svdde/ddeimp.hxx create mode 100644 bf_svtools/source/svdde/ddemldeb.hxx create mode 100644 bf_svtools/source/svdde/ddemlimp.hxx create mode 100644 bf_svtools/source/svdde/ddemlos2.h create mode 100644 bf_svtools/source/svdde/ddewrap.hxx create mode 100644 bf_svtools/source/svdde/makefile.mk create mode 100644 bf_svtools/source/svdde/svt_ddecli.cxx create mode 100644 bf_svtools/source/svdde/svt_ddedata.cxx create mode 100644 bf_svtools/source/svdde/svt_ddedll.cxx create mode 100644 bf_svtools/source/svdde/svt_ddedummy.cxx create mode 100644 bf_svtools/source/svdde/svt_ddeinf.cxx create mode 100644 bf_svtools/source/svdde/svt_ddeml1.cxx create mode 100644 bf_svtools/source/svdde/svt_ddeml2.cxx create mode 100644 bf_svtools/source/svdde/svt_ddemldeb.cxx create mode 100644 bf_svtools/source/svdde/svt_ddestrg.cxx create mode 100644 bf_svtools/source/svdde/svt_ddesvr.cxx create mode 100644 bf_svtools/source/svdde/svt_ddewrap.cxx create mode 100644 bf_svtools/source/syslocale/makefile.mk create mode 100644 bf_svtools/source/syslocale/svt_syslocale.cxx create mode 100644 bf_svtools/source/undo/makefile.mk create mode 100644 bf_svtools/source/undo/svt_undo.cxx create mode 100644 bf_svtools/source/uno/makefile.mk create mode 100644 bf_svtools/source/uno/svt_registerservices.cxx create mode 100644 bf_svtools/source/uno/svt_unoevent.cxx create mode 100644 bf_svtools/source/uno/svt_unoimap.cxx create mode 100644 bf_svtools/util/bf_svt.component create mode 100644 bf_svtools/util/makefile.mk create mode 100644 bf_svtools/util/svt.flt create mode 100644 bf_svx/source/dialog/impgrf.hrc create mode 100644 bf_svx/source/dialog/makefile.mk create mode 100644 bf_svx/source/dialog/svx_dlgutil.cxx create mode 100644 bf_svx/source/dialog/svx_impgrf.cxx create mode 100644 bf_svx/source/dialog/svx_impgrf.src create mode 100644 bf_svx/source/dialog/svx_lingu.src create mode 100644 bf_svx/source/dialog/svx_rulritem.cxx create mode 100644 bf_svx/source/dialog/svx_sdstring.src create mode 100644 bf_svx/source/editeng/editattr.hxx create mode 100644 bf_svx/source/editeng/editdoc.hxx create mode 100644 bf_svx/source/editeng/editeng.hrc create mode 100644 bf_svx/source/editeng/editobj2.hxx create mode 100644 bf_svx/source/editeng/editsel.hxx create mode 100644 bf_svx/source/editeng/editstt2.hxx create mode 100644 bf_svx/source/editeng/editundo.hxx create mode 100644 bf_svx/source/editeng/eerdll2.hxx create mode 100644 bf_svx/source/editeng/impedit.hxx create mode 100644 bf_svx/source/editeng/makefile.mk create mode 100644 bf_svx/source/editeng/svx_editattr.cxx create mode 100644 bf_svx/source/editeng/svx_editdbg.cxx create mode 100644 bf_svx/source/editeng/svx_editdoc.cxx create mode 100644 bf_svx/source/editeng/svx_editdoc2.cxx create mode 100644 bf_svx/source/editeng/svx_editeng.cxx create mode 100644 bf_svx/source/editeng/svx_editeng.src create mode 100644 bf_svx/source/editeng/svx_editobj.cxx create mode 100644 bf_svx/source/editeng/svx_editsel.cxx create mode 100644 bf_svx/source/editeng/svx_editundo.cxx create mode 100644 bf_svx/source/editeng/svx_editview.cxx create mode 100644 bf_svx/source/editeng/svx_eerdll.cxx create mode 100644 bf_svx/source/editeng/svx_forbiddencharacterstable.cxx create mode 100644 bf_svx/source/editeng/svx_impedit.cxx create mode 100644 bf_svx/source/editeng/svx_impedit2.cxx create mode 100644 bf_svx/source/editeng/svx_impedit3.cxx create mode 100644 bf_svx/source/editeng/svx_impedit4.cxx create mode 100644 bf_svx/source/editeng/svx_impedit5.cxx create mode 100644 bf_svx/source/editeng/svx_swafopt.cxx create mode 100644 bf_svx/source/editeng/svx_txtrange.cxx create mode 100644 bf_svx/source/editeng/svx_unolingu.cxx create mode 100644 bf_svx/source/engine3d/makefile.mk create mode 100644 bf_svx/source/engine3d/svx_camera3d.cxx create mode 100644 bf_svx/source/engine3d/svx_class3d.cxx create mode 100644 bf_svx/source/engine3d/svx_cube3d.cxx create mode 100644 bf_svx/source/engine3d/svx_deflt3d.cxx create mode 100644 bf_svx/source/engine3d/svx_dlight3d.cxx create mode 100644 bf_svx/source/engine3d/svx_e3dcmpt.cxx create mode 100644 bf_svx/source/engine3d/svx_extrud3d.cxx create mode 100644 bf_svx/source/engine3d/svx_float3d.cxx create mode 100644 bf_svx/source/engine3d/svx_float3d.src create mode 100644 bf_svx/source/engine3d/svx_label3d.cxx create mode 100644 bf_svx/source/engine3d/svx_lathe3d.cxx create mode 100644 bf_svx/source/engine3d/svx_light3d.cxx create mode 100644 bf_svx/source/engine3d/svx_obj3d.cxx create mode 100644 bf_svx/source/engine3d/svx_objfac3d.cxx create mode 100644 bf_svx/source/engine3d/svx_plight3d.cxx create mode 100644 bf_svx/source/engine3d/svx_pntobj3d.cxx create mode 100644 bf_svx/source/engine3d/svx_poly3d.cxx create mode 100644 bf_svx/source/engine3d/svx_polygn3d.cxx create mode 100644 bf_svx/source/engine3d/svx_polyob3d.cxx create mode 100644 bf_svx/source/engine3d/svx_polysc3d.cxx create mode 100644 bf_svx/source/engine3d/svx_scene3d.cxx create mode 100644 bf_svx/source/engine3d/svx_sphere3d.cxx create mode 100644 bf_svx/source/engine3d/svx_svx3ditems.cxx create mode 100644 bf_svx/source/engine3d/svx_view3d.cxx create mode 100644 bf_svx/source/engine3d/svx_viewpt3d.cxx create mode 100644 bf_svx/source/engine3d/svx_volume3d.cxx create mode 100644 bf_svx/source/form/makefile.mk create mode 100644 bf_svx/source/form/svx_fmdmod.cxx create mode 100644 bf_svx/source/form/svx_fmdpage.cxx create mode 100644 bf_svx/source/form/svx_fmimplids.cxx create mode 100644 bf_svx/source/form/svx_fmmodel.cxx create mode 100644 bf_svx/source/form/svx_fmobj.cxx create mode 100644 bf_svx/source/form/svx_fmobjfac.cxx create mode 100644 bf_svx/source/form/svx_fmpage.cxx create mode 100644 bf_svx/source/form/svx_fmpgeimp.cxx create mode 100644 bf_svx/source/form/svx_fmprop.cxx create mode 100644 bf_svx/source/form/svx_fmsearch.src create mode 100644 bf_svx/source/form/svx_fmstring.src create mode 100644 bf_svx/source/form/svx_fmtools.cxx create mode 100644 bf_svx/source/form/svx_siimport.cxx create mode 100644 bf_svx/source/form/svx_tbxform.src create mode 100644 bf_svx/source/inc/XPropertyTable.hxx create mode 100644 bf_svx/source/inc/fmexch.hxx create mode 100644 bf_svx/source/inc/fmimplids.hxx create mode 100644 bf_svx/source/inc/fmobj.hxx create mode 100644 bf_svx/source/inc/fmpgeimp.hxx create mode 100644 bf_svx/source/inc/fmprop.hrc create mode 100644 bf_svx/source/inc/fmresids.hrc create mode 100644 bf_svx/source/inc/fmsearch.hrc create mode 100644 bf_svx/source/inc/fmservs.hxx create mode 100644 bf_svx/source/inc/fmshimp.hxx create mode 100644 bf_svx/source/inc/fmstatic.hxx create mode 100644 bf_svx/source/inc/fmtools.hxx create mode 100644 bf_svx/source/inc/mutxhelp.hxx create mode 100644 bf_svx/source/inc/svdoimp.hxx create mode 100644 bf_svx/source/inc/svdoutlinercache.hxx create mode 100644 bf_svx/source/inc/unoedprx.hxx create mode 100644 bf_svx/source/inc/unopolyhelper.hxx create mode 100644 bf_svx/source/inc/xmlxtexp.hxx create mode 100644 bf_svx/source/inc/xmlxtimp.hxx create mode 100644 bf_svx/source/items/makefile.mk create mode 100644 bf_svx/source/items/svx_algitem.cxx create mode 100644 bf_svx/source/items/svx_bulitem.cxx create mode 100644 bf_svx/source/items/svx_chrtitem.cxx create mode 100644 bf_svx/source/items/svx_clipfmtitem.cxx create mode 100644 bf_svx/source/items/svx_drawitem.cxx create mode 100644 bf_svx/source/items/svx_e3ditem.cxx create mode 100644 bf_svx/source/items/svx_flditem.cxx create mode 100644 bf_svx/source/items/svx_frmitems.cxx create mode 100644 bf_svx/source/items/svx_grfitem.cxx create mode 100644 bf_svx/source/items/svx_numitem.cxx create mode 100644 bf_svx/source/items/svx_pageitem.cxx create mode 100644 bf_svx/source/items/svx_paperinf.cxx create mode 100644 bf_svx/source/items/svx_paraitem.cxx create mode 100644 bf_svx/source/items/svx_postattr.cxx create mode 100644 bf_svx/source/items/svx_rotmodit.cxx create mode 100644 bf_svx/source/items/svx_svxerr.cxx create mode 100644 bf_svx/source/items/svx_svxerr.src create mode 100644 bf_svx/source/items/svx_svxfont.cxx create mode 100644 bf_svx/source/items/svx_svxitems.src create mode 100644 bf_svx/source/items/svx_textitem.cxx create mode 100644 bf_svx/source/items/svx_writingmodeitem.cxx create mode 100644 bf_svx/source/items/svx_xmlcnitm.cxx create mode 100644 bf_svx/source/items/svx_zoomitem.cxx create mode 100644 bf_svx/source/options/makefile.mk create mode 100644 bf_svx/source/options/svx_adritem.cxx create mode 100644 bf_svx/source/options/svx_asiancfg.cxx create mode 100644 bf_svx/source/options/svx_optdll.cxx create mode 100644 bf_svx/source/options/svx_optgrid.cxx create mode 100644 bf_svx/source/outliner/makefile.mk create mode 100644 bf_svx/source/outliner/outl_pch.hxx create mode 100644 bf_svx/source/outliner/outleeng.hxx create mode 100644 bf_svx/source/outliner/outliner.hrc create mode 100644 bf_svx/source/outliner/paralist.hxx create mode 100644 bf_svx/source/outliner/svx_outleeng.cxx create mode 100644 bf_svx/source/outliner/svx_outlin2.cxx create mode 100644 bf_svx/source/outliner/svx_outliner.cxx create mode 100644 bf_svx/source/outliner/svx_outliner.src create mode 100644 bf_svx/source/outliner/svx_outlobj.cxx create mode 100644 bf_svx/source/outliner/svx_outlvw.cxx create mode 100644 bf_svx/source/outliner/svx_paralist.cxx create mode 100644 bf_svx/source/svdraw/makefile.mk create mode 100644 bf_svx/source/svdraw/svditext.hxx create mode 100644 bf_svx/source/svdraw/svdtxhdl.hxx create mode 100644 bf_svx/source/svdraw/svx_dialdll.cxx create mode 100644 bf_svx/source/svdraw/svx_impgrfll.cxx create mode 100644 bf_svx/source/svdraw/svx_svdattr.cxx create mode 100644 bf_svx/source/svdraw/svx_svdcrtv.cxx create mode 100644 bf_svx/source/svdraw/svx_svddrgv.cxx create mode 100644 bf_svx/source/svdraw/svx_svdedtv.cxx create mode 100644 bf_svx/source/svdraw/svx_svdedtv2.cxx create mode 100644 bf_svx/source/svdraw/svx_svdedxv.cxx create mode 100644 bf_svx/source/svdraw/svx_svdetc.cxx create mode 100644 bf_svx/source/svdraw/svx_svdglev.cxx create mode 100644 bf_svx/source/svdraw/svx_svdglue.cxx create mode 100644 bf_svx/source/svdraw/svx_svdhdl.cxx create mode 100644 bf_svx/source/svdraw/svx_svdhlpln.cxx create mode 100644 bf_svx/source/svdraw/svx_svdio.cxx create mode 100644 bf_svx/source/svdraw/svx_svditer.cxx create mode 100644 bf_svx/source/svdraw/svx_svdlayer.cxx create mode 100644 bf_svx/source/svdraw/svx_svdmark.cxx create mode 100644 bf_svx/source/svdraw/svx_svdmodel.cxx create mode 100644 bf_svx/source/svdraw/svx_svdmrkv.cxx create mode 100644 bf_svx/source/svdraw/svx_svdmrkv1.cxx create mode 100644 bf_svx/source/svdraw/svx_svdoattr.cxx create mode 100644 bf_svx/source/svdraw/svx_svdobj.cxx create mode 100644 bf_svx/source/svdraw/svx_svdocapt.cxx create mode 100644 bf_svx/source/svdraw/svx_svdocirc.cxx create mode 100644 bf_svx/source/svdraw/svx_svdoedge.cxx create mode 100644 bf_svx/source/svdraw/svx_svdograf.cxx create mode 100644 bf_svx/source/svdraw/svx_svdogrp.cxx create mode 100644 bf_svx/source/svdraw/svx_svdomeas.cxx create mode 100644 bf_svx/source/svdraw/svx_svdoole2.cxx create mode 100644 bf_svx/source/svdraw/svx_svdopage.cxx create mode 100644 bf_svx/source/svdraw/svx_svdopath.cxx create mode 100644 bf_svx/source/svdraw/svx_svdorect.cxx create mode 100644 bf_svx/source/svdraw/svx_svdotext.cxx create mode 100644 bf_svx/source/svdraw/svx_svdotxat.cxx create mode 100644 bf_svx/source/svdraw/svx_svdotxed.cxx create mode 100644 bf_svx/source/svdraw/svx_svdotxfl.cxx create mode 100644 bf_svx/source/svdraw/svx_svdotxln.cxx create mode 100644 bf_svx/source/svdraw/svx_svdotxtr.cxx create mode 100644 bf_svx/source/svdraw/svx_svdouno.cxx create mode 100644 bf_svx/source/svdraw/svx_svdoutl.cxx create mode 100644 bf_svx/source/svdraw/svx_svdoutlinercache.cxx create mode 100644 bf_svx/source/svdraw/svx_svdovirt.cxx create mode 100644 bf_svx/source/svdraw/svx_svdpage.cxx create mode 100644 bf_svx/source/svdraw/svx_svdpagv.cxx create mode 100644 bf_svx/source/svdraw/svx_svdpntv.cxx create mode 100644 bf_svx/source/svdraw/svx_svdpoev.cxx create mode 100644 bf_svx/source/svdraw/svx_svdsnpv.cxx create mode 100644 bf_svx/source/svdraw/svx_svdstr.src create mode 100644 bf_svx/source/svdraw/svx_svdsuro.cxx create mode 100644 bf_svx/source/svdraw/svx_svdtouch.cxx create mode 100644 bf_svx/source/svdraw/svx_svdtrans.cxx create mode 100644 bf_svx/source/svdraw/svx_svdtxhdl.cxx create mode 100644 bf_svx/source/svdraw/svx_svdundo.cxx create mode 100644 bf_svx/source/svdraw/svx_svdview.cxx create mode 100644 bf_svx/source/svdraw/svx_svdviter.cxx create mode 100644 bf_svx/source/svdraw/svx_svdvmark.cxx create mode 100644 bf_svx/source/svdraw/svx_svdxcgv.cxx create mode 100644 bf_svx/source/svxlink/fileobj.hxx create mode 100644 bf_svx/source/svxlink/makefile.mk create mode 100644 bf_svx/source/svxlink/svx_fileobj.cxx create mode 100644 bf_svx/source/svxlink/svx_linkmgr.cxx create mode 100644 bf_svx/source/svxlink/svx_linkmgr.src create mode 100644 bf_svx/source/unodraw/UnoGraphicExporter.hxx create mode 100644 bf_svx/source/unodraw/UnoNameItemTable.hxx create mode 100644 bf_svx/source/unodraw/makefile.mk create mode 100644 bf_svx/source/unodraw/shapeimpl.hxx create mode 100644 bf_svx/source/unodraw/svx_UnoNameItemTable.cxx create mode 100644 bf_svx/source/unodraw/svx_UnoNamespaceMap.cxx create mode 100644 bf_svx/source/unodraw/svx_XPropertyTable.cxx create mode 100644 bf_svx/source/unodraw/svx_gluepts.cxx create mode 100644 bf_svx/source/unodraw/svx_unobtabl.cxx create mode 100644 bf_svx/source/unodraw/svx_unoctabl.cxx create mode 100644 bf_svx/source/unodraw/svx_unodtabl.cxx create mode 100644 bf_svx/source/unodraw/svx_unofdesc.cxx create mode 100644 bf_svx/source/unodraw/svx_unogtabl.cxx create mode 100644 bf_svx/source/unodraw/svx_unohtabl.cxx create mode 100644 bf_svx/source/unodraw/svx_unoipset.cxx create mode 100644 bf_svx/source/unodraw/svx_unomlstr.cxx create mode 100644 bf_svx/source/unodraw/svx_unomod.cxx create mode 100644 bf_svx/source/unodraw/svx_unomtabl.cxx create mode 100644 bf_svx/source/unodraw/svx_unonrule.cxx create mode 100644 bf_svx/source/unodraw/svx_unontabl.cxx create mode 100644 bf_svx/source/unodraw/svx_unopage.cxx create mode 100644 bf_svx/source/unodraw/svx_unopool.cxx create mode 100644 bf_svx/source/unodraw/svx_unoprov.cxx create mode 100644 bf_svx/source/unodraw/svx_unoshap2.cxx create mode 100644 bf_svx/source/unodraw/svx_unoshap3.cxx create mode 100644 bf_svx/source/unodraw/svx_unoshap4.cxx create mode 100644 bf_svx/source/unodraw/svx_unoshape.cxx create mode 100644 bf_svx/source/unodraw/svx_unoshcol.cxx create mode 100644 bf_svx/source/unodraw/svx_unoshtxt.cxx create mode 100644 bf_svx/source/unodraw/svx_unottabl.cxx create mode 100644 bf_svx/source/unoedit/makefile.mk create mode 100644 bf_svx/source/unoedit/svx_UnoForbiddenCharsTable.cxx create mode 100644 bf_svx/source/unoedit/svx_unoedhlp.cxx create mode 100644 bf_svx/source/unoedit/svx_unoedprx.cxx create mode 100644 bf_svx/source/unoedit/svx_unoedsrc.cxx create mode 100644 bf_svx/source/unoedit/svx_unofield.cxx create mode 100644 bf_svx/source/unoedit/svx_unofored.cxx create mode 100644 bf_svx/source/unoedit/svx_unoforou.cxx create mode 100644 bf_svx/source/unoedit/svx_unotext.cxx create mode 100644 bf_svx/source/unoedit/svx_unotext2.cxx create mode 100644 bf_svx/source/unoedit/svx_unoviwed.cxx create mode 100644 bf_svx/source/unoedit/svx_unoviwou.cxx create mode 100644 bf_svx/source/xml/editsource.hxx create mode 100644 bf_svx/source/xml/makefile.mk create mode 100644 bf_svx/source/xml/svx_xmleohlp.cxx create mode 100644 bf_svx/source/xml/svx_xmlgrhlp.cxx create mode 100644 bf_svx/source/xml/svx_xmltxtexp.cxx create mode 100644 bf_svx/source/xml/svx_xmltxtimp.cxx create mode 100644 bf_svx/source/xml/svx_xmlxtexp.cxx create mode 100644 bf_svx/source/xml/svx_xmlxtimp.cxx create mode 100644 bf_svx/source/xoutdev/makefile.mk create mode 100644 bf_svx/source/xoutdev/svx__xfont.cxx create mode 100644 bf_svx/source/xoutdev/svx__ximp.cxx create mode 100644 bf_svx/source/xoutdev/svx__xoutbmp.cxx create mode 100644 bf_svx/source/xoutdev/svx__xpoly.cxx create mode 100644 bf_svx/source/xoutdev/svx_xattr.cxx create mode 100644 bf_svx/source/xoutdev/svx_xattr2.cxx create mode 100644 bf_svx/source/xoutdev/svx_xattrbmp.cxx create mode 100644 bf_svx/source/xoutdev/svx_xfontmac.cxx create mode 100644 bf_svx/source/xoutdev/svx_xiocomp.cxx create mode 100644 bf_svx/source/xoutdev/svx_xline.cxx create mode 100644 bf_svx/source/xoutdev/svx_xout.cxx create mode 100644 bf_svx/source/xoutdev/svx_xout1.cxx create mode 100644 bf_svx/source/xoutdev/svx_xpool.cxx create mode 100644 bf_svx/source/xoutdev/svx_xtabbtmp.cxx create mode 100644 bf_svx/source/xoutdev/svx_xtabcolr.cxx create mode 100644 bf_svx/source/xoutdev/svx_xtabdash.cxx create mode 100644 bf_svx/source/xoutdev/svx_xtabgrdt.cxx create mode 100644 bf_svx/source/xoutdev/svx_xtabhtch.cxx create mode 100644 bf_svx/source/xoutdev/svx_xtable.cxx create mode 100644 bf_svx/source/xoutdev/svx_xtablend.cxx create mode 100644 bf_svx/util/bf_sfxwin.flt create mode 100644 bf_svx/util/bf_svx.component create mode 100644 bf_svx/util/bf_svx.flt create mode 100644 bf_svx/util/dl.flt create mode 100644 bf_svx/util/gal.dxp create mode 100644 bf_svx/util/hidother.hrc create mode 100644 bf_svx/util/makefile.mk create mode 100644 bf_svx/util/svx.dxp create mode 100644 bf_svx/util/svx_hidother.src create mode 100644 bf_svx/util/svx_svxpch.cxx create mode 100644 bf_sw/source/core/attr/makefile.mk create mode 100644 bf_sw/source/core/attr/sw_calbck.cxx create mode 100644 bf_sw/source/core/attr/sw_cellatr.cxx create mode 100644 bf_sw/source/core/attr/sw_format.cxx create mode 100644 bf_sw/source/core/attr/sw_hints.cxx create mode 100644 bf_sw/source/core/attr/sw_swatrset.cxx create mode 100644 bf_sw/source/core/bastyp/makefile.mk create mode 100644 bf_sw/source/core/bastyp/sw_bparr.cxx create mode 100644 bf_sw/source/core/bastyp/sw_breakit.cxx create mode 100644 bf_sw/source/core/bastyp/sw_calc.cxx create mode 100644 bf_sw/source/core/bastyp/sw_checkit.cxx create mode 100644 bf_sw/source/core/bastyp/sw_index.cxx create mode 100644 bf_sw/source/core/bastyp/sw_init.cxx create mode 100644 bf_sw/source/core/bastyp/sw_ring.cxx create mode 100644 bf_sw/source/core/bastyp/sw_swcache.cxx create mode 100644 bf_sw/source/core/bastyp/sw_swrect.cxx create mode 100644 bf_sw/source/core/bastyp/sw_swregion.cxx create mode 100644 bf_sw/source/core/bastyp/sw_swtypes.cxx create mode 100644 bf_sw/source/core/crsr/makefile.mk create mode 100644 bf_sw/source/core/crsr/sw_bookmrk.cxx create mode 100644 bf_sw/source/core/crsr/sw_crsrsh.cxx create mode 100644 bf_sw/source/core/crsr/sw_pam.cxx create mode 100644 bf_sw/source/core/crsr/sw_paminit.cxx create mode 100644 bf_sw/source/core/crsr/sw_splcstk.cxx create mode 100644 bf_sw/source/core/crsr/sw_swcrsr.cxx create mode 100644 bf_sw/source/core/crsr/sw_trvltbl.cxx create mode 100644 bf_sw/source/core/crsr/sw_unocrsr.cxx create mode 100644 bf_sw/source/core/crsr/sw_viscrs.cxx create mode 100644 bf_sw/source/core/doc/makefile.mk create mode 100644 bf_sw/source/core/doc/sw_SwStyleNameMapper.cxx create mode 100644 bf_sw/source/core/doc/sw_doc.cxx create mode 100644 bf_sw/source/core/doc/sw_docbm.cxx create mode 100644 bf_sw/source/core/doc/sw_docchart.cxx create mode 100644 bf_sw/source/core/doc/sw_doccorr.cxx create mode 100644 bf_sw/source/core/doc/sw_docdde.cxx create mode 100644 bf_sw/source/core/doc/sw_docdesc.cxx create mode 100644 bf_sw/source/core/doc/sw_docdraw.cxx create mode 100644 bf_sw/source/core/doc/sw_docedt.cxx create mode 100644 bf_sw/source/core/doc/sw_docfld.cxx create mode 100644 bf_sw/source/core/doc/sw_docfly.cxx create mode 100644 bf_sw/source/core/doc/sw_docfmt.cxx create mode 100644 bf_sw/source/core/doc/sw_docftn.cxx create mode 100644 bf_sw/source/core/doc/sw_doclay.cxx create mode 100644 bf_sw/source/core/doc/sw_docnew.cxx create mode 100644 bf_sw/source/core/doc/sw_docnum.cxx create mode 100644 bf_sw/source/core/doc/sw_docredln.cxx create mode 100644 bf_sw/source/core/doc/sw_docruby.cxx create mode 100644 bf_sw/source/core/doc/sw_docstat.cxx create mode 100644 bf_sw/source/core/doc/sw_doctxm.cxx create mode 100644 bf_sw/source/core/doc/sw_fmtcol.cxx create mode 100644 bf_sw/source/core/doc/sw_ftnidx.cxx create mode 100644 bf_sw/source/core/doc/sw_gctable.cxx create mode 100644 bf_sw/source/core/doc/sw_lineinfo.cxx create mode 100644 bf_sw/source/core/doc/sw_notxtfrm.cxx create mode 100644 bf_sw/source/core/doc/sw_number.cxx create mode 100644 bf_sw/source/core/doc/sw_numpara.cxx create mode 100644 bf_sw/source/core/doc/sw_poolfmt.cxx create mode 100644 bf_sw/source/core/doc/sw_sortopt.cxx create mode 100644 bf_sw/source/core/doc/sw_swserv.cxx create mode 100644 bf_sw/source/core/doc/sw_swtable.cxx create mode 100644 bf_sw/source/core/doc/sw_tblafmt.cxx create mode 100644 bf_sw/source/core/doc/sw_tblrwcl.cxx create mode 100644 bf_sw/source/core/doc/sw_visiturl.cxx create mode 100644 bf_sw/source/core/docnode/makefile.mk create mode 100644 bf_sw/source/core/docnode/sw_ndarr.cxx create mode 100644 bf_sw/source/core/docnode/sw_ndcopy.cxx create mode 100644 bf_sw/source/core/docnode/sw_ndindex.cxx create mode 100644 bf_sw/source/core/docnode/sw_ndnotxt.cxx create mode 100644 bf_sw/source/core/docnode/sw_ndnum.cxx create mode 100644 bf_sw/source/core/docnode/sw_ndsect.cxx create mode 100644 bf_sw/source/core/docnode/sw_ndtbl.cxx create mode 100644 bf_sw/source/core/docnode/sw_ndtbl1.cxx create mode 100644 bf_sw/source/core/docnode/sw_node.cxx create mode 100644 bf_sw/source/core/docnode/sw_node2lay.cxx create mode 100644 bf_sw/source/core/docnode/sw_nodes.cxx create mode 100644 bf_sw/source/core/docnode/sw_section.cxx create mode 100644 bf_sw/source/core/docnode/sw_swbaslnk.cxx create mode 100644 bf_sw/source/core/draw/makefile.mk create mode 100644 bf_sw/source/core/draw/sw_dcontact.cxx create mode 100644 bf_sw/source/core/draw/sw_dflyobj.cxx create mode 100644 bf_sw/source/core/draw/sw_dobjfac.cxx create mode 100644 bf_sw/source/core/draw/sw_dpage.cxx create mode 100644 bf_sw/source/core/draw/sw_drawdoc.cxx create mode 100644 bf_sw/source/core/draw/sw_dview.cxx create mode 100644 bf_sw/source/core/fields/makefile.mk create mode 100644 bf_sw/source/core/fields/sw_authfld.cxx create mode 100644 bf_sw/source/core/fields/sw_cellfml.cxx create mode 100644 bf_sw/source/core/fields/sw_chpfld.cxx create mode 100644 bf_sw/source/core/fields/sw_dbfld.cxx create mode 100644 bf_sw/source/core/fields/sw_ddefld.cxx create mode 100644 bf_sw/source/core/fields/sw_ddetbl.cxx create mode 100644 bf_sw/source/core/fields/sw_docufld.cxx create mode 100644 bf_sw/source/core/fields/sw_expfld.cxx create mode 100644 bf_sw/source/core/fields/sw_fldbas.cxx create mode 100644 bf_sw/source/core/fields/sw_flddat.cxx create mode 100644 bf_sw/source/core/fields/sw_flddropdown.cxx create mode 100644 bf_sw/source/core/fields/sw_inetfld.cxx create mode 100644 bf_sw/source/core/fields/sw_macrofld.cxx create mode 100644 bf_sw/source/core/fields/sw_reffld.cxx create mode 100644 bf_sw/source/core/fields/sw_scrptfld.cxx create mode 100644 bf_sw/source/core/fields/sw_tblcalc.cxx create mode 100644 bf_sw/source/core/fields/sw_usrfld.cxx create mode 100644 bf_sw/source/core/frmedt/makefile.mk create mode 100644 bf_sw/source/core/frmedt/sw_fefly1.cxx create mode 100644 bf_sw/source/core/frmedt/sw_fetab.cxx create mode 100644 bf_sw/source/core/frmedt/sw_fews.cxx create mode 100644 bf_sw/source/core/frmedt/sw_tblsel.cxx create mode 100644 bf_sw/source/core/graphic/makefile.mk create mode 100644 bf_sw/source/core/graphic/sw_grfatr.cxx create mode 100644 bf_sw/source/core/graphic/sw_ndgrf.cxx create mode 100644 bf_sw/source/core/inc/GetMetricVal.hxx create mode 100644 bf_sw/source/core/inc/SwXTextDefaults.hxx create mode 100644 bf_sw/source/core/inc/atrhndl.hxx create mode 100644 bf_sw/source/core/inc/blink.hxx create mode 100644 bf_sw/source/core/inc/bodyfrm.hxx create mode 100644 bf_sw/source/core/inc/cellfrm.hxx create mode 100644 bf_sw/source/core/inc/cntfrm.hxx create mode 100644 bf_sw/source/core/inc/colfrm.hxx create mode 100644 bf_sw/source/core/inc/dflyobj.hxx create mode 100644 bf_sw/source/core/inc/docfld.hxx create mode 100644 bf_sw/source/core/inc/docfunc.hxx create mode 100644 bf_sw/source/core/inc/doctxm.hxx create mode 100644 bf_sw/source/core/inc/drawfont.hxx create mode 100644 bf_sw/source/core/inc/dview.hxx create mode 100644 bf_sw/source/core/inc/flowfrm.hxx create mode 100644 bf_sw/source/core/inc/flyfrm.hxx create mode 100644 bf_sw/source/core/inc/flyfrms.hxx create mode 100644 bf_sw/source/core/inc/fntcache.hxx create mode 100644 bf_sw/source/core/inc/frame.hxx create mode 100644 bf_sw/source/core/inc/frmtool.hxx create mode 100644 bf_sw/source/core/inc/ftnboss.hxx create mode 100644 bf_sw/source/core/inc/ftnfrm.hxx create mode 100644 bf_sw/source/core/inc/hffrm.hxx create mode 100644 bf_sw/source/core/inc/laycache.hxx create mode 100644 bf_sw/source/core/inc/layfrm.hxx create mode 100644 bf_sw/source/core/inc/mvsave.hxx create mode 100644 bf_sw/source/core/inc/node2lay.hxx create mode 100644 bf_sw/source/core/inc/noteurl.hxx create mode 100644 bf_sw/source/core/inc/notxtfrm.hxx create mode 100644 bf_sw/source/core/inc/numpara.hxx create mode 100644 bf_sw/source/core/inc/pagefrm.hxx create mode 100644 bf_sw/source/core/inc/pamtyp.hxx create mode 100644 bf_sw/source/core/inc/prevwpage.hxx create mode 100644 bf_sw/source/core/inc/ptqueue.hxx create mode 100644 bf_sw/source/core/inc/rootfrm.hxx create mode 100644 bf_sw/source/core/inc/rowfrm.hxx create mode 100644 bf_sw/source/core/inc/scrrect.hxx create mode 100644 bf_sw/source/core/inc/sectfrm.hxx create mode 100644 bf_sw/source/core/inc/splcstk.hxx create mode 100644 bf_sw/source/core/inc/swcache.hxx create mode 100644 bf_sw/source/core/inc/swfntcch.hxx create mode 100644 bf_sw/source/core/inc/swfont.hxx create mode 100644 bf_sw/source/core/inc/tabfrm.hxx create mode 100644 bf_sw/source/core/inc/tblrwcl.hxx create mode 100644 bf_sw/source/core/inc/txmsrt.hxx create mode 100644 bf_sw/source/core/inc/txtfrm.hxx create mode 100644 bf_sw/source/core/inc/txttypes.hxx create mode 100644 bf_sw/source/core/inc/unoclbck.hxx create mode 100644 bf_sw/source/core/inc/unofldmid.h create mode 100644 bf_sw/source/core/inc/viewimp.hxx create mode 100644 bf_sw/source/core/inc/visiturl.hxx create mode 100644 bf_sw/source/core/inc/wrong.hxx create mode 100644 bf_sw/source/core/layout/layhelp.hxx create mode 100644 bf_sw/source/core/layout/makefile.mk create mode 100644 bf_sw/source/core/layout/sw_atrfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_calcmove.cxx create mode 100644 bf_sw/source/core/layout/sw_colfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_findfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_flowfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_fly.cxx create mode 100644 bf_sw/source/core/layout/sw_flycnt.cxx create mode 100644 bf_sw/source/core/layout/sw_flyincnt.cxx create mode 100644 bf_sw/source/core/layout/sw_flylay.cxx create mode 100644 bf_sw/source/core/layout/sw_frmtool.cxx create mode 100644 bf_sw/source/core/layout/sw_ftnfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_hffrm.cxx create mode 100644 bf_sw/source/core/layout/sw_laycache.cxx create mode 100644 bf_sw/source/core/layout/sw_newfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_pagechg.cxx create mode 100644 bf_sw/source/core/layout/sw_pagedesc.cxx create mode 100644 bf_sw/source/core/layout/sw_paintfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_sectfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_ssfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_tabfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_trvlfrm.cxx create mode 100644 bf_sw/source/core/layout/sw_unusedf.cxx create mode 100644 bf_sw/source/core/layout/sw_wsfrm.cxx create mode 100644 bf_sw/source/core/layout/virtoutp.hxx create mode 100644 bf_sw/source/core/makefile.mk create mode 100644 bf_sw/source/core/ole/makefile.mk create mode 100644 bf_sw/source/core/ole/sw_ndole.cxx create mode 100644 bf_sw/source/core/para/makefile.mk create mode 100644 bf_sw/source/core/para/sw_paratr.cxx create mode 100644 bf_sw/source/core/sw3io/crypter.hxx create mode 100644 bf_sw/source/core/sw3io/makefile.mk create mode 100644 bf_sw/source/core/sw3io/sw3ids.hxx create mode 100644 bf_sw/source/core/sw3io/sw3imp.hxx create mode 100644 bf_sw/source/core/sw3io/sw3marks.hxx create mode 100644 bf_sw/source/core/sw3io/sw_crypter.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3attr.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3block.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3doc.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3field.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3fmts.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3imp.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3io.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3misc.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3nodes.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3npool.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3num.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3page.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3redln.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3sectn.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3style.cxx create mode 100644 bf_sw/source/core/sw3io/sw_sw3table.cxx create mode 100644 bf_sw/source/core/swg/frmids.hxx create mode 100644 bf_sw/source/core/swg/makefile.mk create mode 100644 bf_sw/source/core/swg/oldhntid.hxx create mode 100644 bf_sw/source/core/swg/rdswg.hxx create mode 100644 bf_sw/source/core/swg/sw_rdcont.cxx create mode 100644 bf_sw/source/core/swg/sw_rdflds.cxx create mode 100644 bf_sw/source/core/swg/sw_rdfmts.cxx create mode 100644 bf_sw/source/core/swg/sw_rdhnt.cxx create mode 100644 bf_sw/source/core/swg/sw_rdmisc.cxx create mode 100644 bf_sw/source/core/swg/sw_rdnds.cxx create mode 100644 bf_sw/source/core/swg/sw_rdnum.cxx create mode 100644 bf_sw/source/core/swg/sw_rdpage.cxx create mode 100644 bf_sw/source/core/swg/sw_rdswg.cxx create mode 100644 bf_sw/source/core/swg/sw_rdtox.cxx create mode 100644 bf_sw/source/core/swg/sw_swgpar.cxx create mode 100644 bf_sw/source/core/swg/sw_swgstr.cxx create mode 100644 bf_sw/source/core/swg/swgids.hxx create mode 100644 bf_sw/source/core/text/guess.hxx create mode 100644 bf_sw/source/core/text/inftxt.hxx create mode 100644 bf_sw/source/core/text/itratr.hxx create mode 100644 bf_sw/source/core/text/itrform2.hxx create mode 100644 bf_sw/source/core/text/itrpaint.hxx create mode 100644 bf_sw/source/core/text/itrtxt.hxx create mode 100644 bf_sw/source/core/text/makefile.mk create mode 100644 bf_sw/source/core/text/pordrop.hxx create mode 100644 bf_sw/source/core/text/porexp.hxx create mode 100644 bf_sw/source/core/text/porfld.hxx create mode 100644 bf_sw/source/core/text/porfly.hxx create mode 100644 bf_sw/source/core/text/porftn.hxx create mode 100644 bf_sw/source/core/text/porglue.hxx create mode 100644 bf_sw/source/core/text/porhyph.hxx create mode 100644 bf_sw/source/core/text/porlay.hxx create mode 100644 bf_sw/source/core/text/porlin.hxx create mode 100644 bf_sw/source/core/text/pormulti.hxx create mode 100644 bf_sw/source/core/text/porref.hxx create mode 100644 bf_sw/source/core/text/porrst.hxx create mode 100644 bf_sw/source/core/text/portab.hxx create mode 100644 bf_sw/source/core/text/portox.hxx create mode 100644 bf_sw/source/core/text/portxt.hxx create mode 100644 bf_sw/source/core/text/possiz.hxx create mode 100644 bf_sw/source/core/text/sw_atrstck.cxx create mode 100644 bf_sw/source/core/text/sw_frmcrsr.cxx create mode 100644 bf_sw/source/core/text/sw_frmform.cxx create mode 100644 bf_sw/source/core/text/sw_guess.cxx create mode 100644 bf_sw/source/core/text/sw_inftxt.cxx create mode 100644 bf_sw/source/core/text/sw_itradj.cxx create mode 100644 bf_sw/source/core/text/sw_itratr.cxx create mode 100644 bf_sw/source/core/text/sw_itrcrsr.cxx create mode 100644 bf_sw/source/core/text/sw_itrform2.cxx create mode 100644 bf_sw/source/core/text/sw_itrpaint.cxx create mode 100644 bf_sw/source/core/text/sw_itrtxt.cxx create mode 100644 bf_sw/source/core/text/sw_noteurl.cxx create mode 100644 bf_sw/source/core/text/sw_porexp.cxx create mode 100644 bf_sw/source/core/text/sw_porfld.cxx create mode 100644 bf_sw/source/core/text/sw_porfly.cxx create mode 100644 bf_sw/source/core/text/sw_porglue.cxx create mode 100644 bf_sw/source/core/text/sw_porlay.cxx create mode 100644 bf_sw/source/core/text/sw_porlin.cxx create mode 100644 bf_sw/source/core/text/sw_pormulti.cxx create mode 100644 bf_sw/source/core/text/sw_porrst.cxx create mode 100644 bf_sw/source/core/text/sw_portox.cxx create mode 100644 bf_sw/source/core/text/sw_portxt.cxx create mode 100644 bf_sw/source/core/text/sw_redlnitr.cxx create mode 100644 bf_sw/source/core/text/sw_txtcache.cxx create mode 100644 bf_sw/source/core/text/sw_txtdrop.cxx create mode 100644 bf_sw/source/core/text/sw_txtfld.cxx create mode 100644 bf_sw/source/core/text/sw_txtfly.cxx create mode 100644 bf_sw/source/core/text/sw_txtfrm.cxx create mode 100644 bf_sw/source/core/text/sw_txtftn.cxx create mode 100644 bf_sw/source/core/text/sw_txthyph.cxx create mode 100644 bf_sw/source/core/text/sw_txtinit.cxx create mode 100644 bf_sw/source/core/text/sw_txtio.cxx create mode 100644 bf_sw/source/core/text/sw_txttab.cxx create mode 100644 bf_sw/source/core/text/sw_widorp.cxx create mode 100644 bf_sw/source/core/text/sw_wrong.cxx create mode 100644 bf_sw/source/core/text/txtcache.hxx create mode 100644 bf_sw/source/core/text/txtcfg.hxx create mode 100644 bf_sw/source/core/text/txtfly.hxx create mode 100644 bf_sw/source/core/text/widorp.hxx create mode 100644 bf_sw/source/core/tox/makefile.mk create mode 100644 bf_sw/source/core/tox/sw_tox.cxx create mode 100644 bf_sw/source/core/tox/sw_toxhlp.cxx create mode 100644 bf_sw/source/core/tox/sw_txmsrt.cxx create mode 100644 bf_sw/source/core/txtnode/makefile.mk create mode 100644 bf_sw/source/core/txtnode/sw_atrfld.cxx create mode 100644 bf_sw/source/core/txtnode/sw_atrflyin.cxx create mode 100644 bf_sw/source/core/txtnode/sw_atrftn.cxx create mode 100644 bf_sw/source/core/txtnode/sw_atrref.cxx create mode 100644 bf_sw/source/core/txtnode/sw_atrtox.cxx create mode 100644 bf_sw/source/core/txtnode/sw_fmtatr1.cxx create mode 100644 bf_sw/source/core/txtnode/sw_fmtatr2.cxx create mode 100644 bf_sw/source/core/txtnode/sw_fntcache.cxx create mode 100644 bf_sw/source/core/txtnode/sw_fntcap.cxx create mode 100644 bf_sw/source/core/txtnode/sw_ndhints.cxx create mode 100644 bf_sw/source/core/txtnode/sw_ndtxt.cxx create mode 100644 bf_sw/source/core/txtnode/sw_swfntcch.cxx create mode 100644 bf_sw/source/core/txtnode/sw_swfont.cxx create mode 100644 bf_sw/source/core/txtnode/sw_thints.cxx create mode 100644 bf_sw/source/core/txtnode/sw_txatbase.cxx create mode 100644 bf_sw/source/core/txtnode/sw_txtatr2.cxx create mode 100644 bf_sw/source/core/txtnode/sw_txtedt.cxx create mode 100644 bf_sw/source/core/unocore/makefile.mk create mode 100644 bf_sw/source/core/unocore/sw_SwXTextDefaults.cxx create mode 100644 bf_sw/source/core/unocore/sw_TextCursorHelper.cxx create mode 100644 bf_sw/source/core/unocore/sw_swunohelper.cxx create mode 100644 bf_sw/source/core/unocore/sw_unobkm.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoclbck.cxx create mode 100644 bf_sw/source/core/unocore/sw_unocoll.cxx create mode 100644 bf_sw/source/core/unocore/sw_unocrsrhelper.cxx create mode 100644 bf_sw/source/core/unocore/sw_unodraw.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoevent.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoevtlstnr.cxx create mode 100644 bf_sw/source/core/unocore/sw_unofield.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoframe.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoftn.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoidx.cxx create mode 100644 bf_sw/source/core/unocore/sw_unomap.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoobj.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoobj2.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoparagraph.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoport.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoportenum.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoprnms.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoredline.cxx create mode 100644 bf_sw/source/core/unocore/sw_unoredlines.cxx create mode 100644 bf_sw/source/core/unocore/sw_unorefmk.cxx create mode 100644 bf_sw/source/core/unocore/sw_unosect.cxx create mode 100644 bf_sw/source/core/unocore/sw_unosett.cxx create mode 100644 bf_sw/source/core/unocore/sw_unosrch.cxx create mode 100644 bf_sw/source/core/unocore/sw_unostyle.cxx create mode 100644 bf_sw/source/core/unocore/sw_unotbl.cxx create mode 100644 bf_sw/source/core/unocore/sw_unotext.cxx create mode 100644 bf_sw/source/core/view/makefile.mk create mode 100644 bf_sw/source/core/view/sw_viewimp.cxx create mode 100644 bf_sw/source/core/view/sw_viewsh.cxx create mode 100644 bf_sw/source/core/view/sw_vnew.cxx create mode 100644 bf_sw/source/core/view/sw_vprint.cxx create mode 100644 bf_sw/source/filter/ascii/makefile.mk create mode 100644 bf_sw/source/filter/ascii/sw_ascatr.cxx create mode 100644 bf_sw/source/filter/ascii/sw_wrtasc.cxx create mode 100644 bf_sw/source/filter/ascii/wrtasc.hxx create mode 100644 bf_sw/source/filter/basflt/makefile.mk create mode 100644 bf_sw/source/filter/basflt/sw_docfact.cxx create mode 100644 bf_sw/source/filter/basflt/sw_fltini.cxx create mode 100644 bf_sw/source/filter/basflt/sw_shellio.cxx create mode 100644 bf_sw/source/filter/excel/exccrts.hxx create mode 100644 bf_sw/source/filter/excel/excdocum.hxx create mode 100644 bf_sw/source/filter/excel/excfntbf.hxx create mode 100644 bf_sw/source/filter/excel/excvfbff.hxx create mode 100644 bf_sw/source/filter/excel/excxfbuf.hxx create mode 100644 bf_sw/source/filter/excel/exlpar.hxx create mode 100644 bf_sw/source/filter/excel/makefile.mk create mode 100644 bf_sw/source/filter/excel/sw_excimpop.cxx create mode 100644 bf_sw/source/filter/excel/sw_excread.cxx create mode 100644 bf_sw/source/filter/excel/sw_exctools.cxx create mode 100644 bf_sw/source/filter/excel/sw_exlpar.cxx create mode 100644 bf_sw/source/filter/excel/sw_fltglbls.cxx create mode 100644 bf_sw/source/filter/inc/SwAppletImpl.hxx create mode 100644 bf_sw/source/filter/inc/fltbase.hxx create mode 100644 bf_sw/source/filter/inc/fltglbls.hxx create mode 100644 bf_sw/source/filter/inc/fltini.hxx create mode 100644 bf_sw/source/filter/inc/wrt_fn.hxx create mode 100644 bf_sw/source/filter/inc/wrtswtbl.hxx create mode 100644 bf_sw/source/filter/lotus/lotpar.hxx create mode 100644 bf_sw/source/filter/lotus/makefile.mk create mode 100644 bf_sw/source/filter/lotus/sw_lotimpop.cxx create mode 100644 bf_sw/source/filter/lotus/sw_lotpar.cxx create mode 100644 bf_sw/source/filter/lotus/sw_lotread.cxx create mode 100644 bf_sw/source/filter/makefile.mk create mode 100644 bf_sw/source/filter/sw6/makefile.mk create mode 100644 bf_sw/source/filter/sw6/sw6file.hxx create mode 100644 bf_sw/source/filter/sw6/sw6par.hxx create mode 100644 bf_sw/source/filter/sw6/sw_sw6file.cxx create mode 100644 bf_sw/source/filter/sw6/sw_sw6par.cxx create mode 100644 bf_sw/source/filter/writer/makefile.mk create mode 100644 bf_sw/source/filter/writer/sw_writer.cxx create mode 100644 bf_sw/source/filter/writer/sw_wrt_fn.cxx create mode 100644 bf_sw/source/filter/writer/sw_wrtswtbl.cxx create mode 100644 bf_sw/source/filter/xml/ForbiddenCharactersEnum.hxx create mode 100644 bf_sw/source/filter/xml/XMLRedlineImportHelper.hxx create mode 100644 bf_sw/source/filter/xml/makefile.mk create mode 100644 bf_sw/source/filter/xml/sw_XMLRedlineImportHelper.cxx create mode 100644 bf_sw/source/filter/xml/sw_swxmlat.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlbrsh.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlexp.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlexpit.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlfmt.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlfmte.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlfonte.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlimp.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlimpit.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlitem.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmliteme.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlitemi.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlitemm.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlithlp.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlitmpr.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlmeta.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmlscript.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmltble.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmltbli.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmltext.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmltexte.cxx create mode 100644 bf_sw/source/filter/xml/sw_xmltexti.cxx create mode 100644 bf_sw/source/filter/xml/xmlbrshe.hxx create mode 100644 bf_sw/source/filter/xml/xmlbrshi.hxx create mode 100644 bf_sw/source/filter/xml/xmlexp.hxx create mode 100644 bf_sw/source/filter/xml/xmlexpit.hxx create mode 100644 bf_sw/source/filter/xml/xmlimp.hxx create mode 100644 bf_sw/source/filter/xml/xmlimpit.hxx create mode 100644 bf_sw/source/filter/xml/xmlitem.hxx create mode 100644 bf_sw/source/filter/xml/xmlithlp.hxx create mode 100644 bf_sw/source/filter/xml/xmlitmap.hxx create mode 100644 bf_sw/source/filter/xml/xmltbli.hxx create mode 100644 bf_sw/source/filter/xml/xmltexte.hxx create mode 100644 bf_sw/source/filter/xml/xmltexti.hxx create mode 100644 bf_sw/source/ui/app/makefile.mk create mode 100644 bf_sw/source/ui/app/sw_app.src create mode 100644 bf_sw/source/ui/app/sw_apphdl.cxx create mode 100644 bf_sw/source/ui/app/sw_docsh.cxx create mode 100644 bf_sw/source/ui/app/sw_docsh2.cxx create mode 100644 bf_sw/source/ui/app/sw_docshdrw.cxx create mode 100644 bf_sw/source/ui/app/sw_docshini.cxx create mode 100644 bf_sw/source/ui/app/sw_docstyle.cxx create mode 100644 bf_sw/source/ui/app/sw_error.src create mode 100644 bf_sw/source/ui/app/sw_mainwn.cxx create mode 100644 bf_sw/source/ui/app/sw_swcomlib.cxx create mode 100644 bf_sw/source/ui/app/sw_swdll.cxx create mode 100644 bf_sw/source/ui/app/sw_swlib.cxx create mode 100644 bf_sw/source/ui/app/sw_swmodul1.cxx create mode 100644 bf_sw/source/ui/app/sw_swmodule.cxx create mode 100644 bf_sw/source/ui/config/config.hrc create mode 100644 bf_sw/source/ui/config/makefile.mk create mode 100644 bf_sw/source/ui/config/optload.hrc create mode 100644 bf_sw/source/ui/config/sw_caption.cxx create mode 100644 bf_sw/source/ui/config/sw_dbconfig.cxx create mode 100644 bf_sw/source/ui/config/sw_fontcfg.cxx create mode 100644 bf_sw/source/ui/config/sw_modcfg.cxx create mode 100644 bf_sw/source/ui/config/sw_optload.src create mode 100644 bf_sw/source/ui/config/sw_prtopt.cxx create mode 100644 bf_sw/source/ui/config/sw_swlinguconfig.cxx create mode 100644 bf_sw/source/ui/config/sw_usrpref.cxx create mode 100644 bf_sw/source/ui/config/sw_viewopt.cxx create mode 100644 bf_sw/source/ui/dbui/makefile.mk create mode 100644 bf_sw/source/ui/dbui/sw_dbmgr.cxx create mode 100644 bf_sw/source/ui/dialog/makefile.mk create mode 100644 bf_sw/source/ui/dialog/regionsw.hrc create mode 100644 bf_sw/source/ui/dialog/sw_regionsw.src create mode 100644 bf_sw/source/ui/fldui/fldui.hrc create mode 100644 bf_sw/source/ui/fldui/makefile.mk create mode 100644 bf_sw/source/ui/fldui/sw_fldmgr.cxx create mode 100644 bf_sw/source/ui/fldui/sw_fldui.src create mode 100644 bf_sw/source/ui/globdoc/makefile.mk create mode 100644 bf_sw/source/ui/globdoc/sw_globdoc.cxx create mode 100644 bf_sw/source/ui/globdoc/sw_globdoc.src create mode 100644 bf_sw/source/ui/inc/SwXFilterOptions.hxx create mode 100644 bf_sw/source/ui/inc/app.hrc create mode 100644 bf_sw/source/ui/inc/barcfg.hxx create mode 100644 bf_sw/source/ui/inc/caption.hxx create mode 100644 bf_sw/source/ui/inc/ccoll.hxx create mode 100644 bf_sw/source/ui/inc/cfgid.h create mode 100644 bf_sw/source/ui/inc/content.hxx create mode 100644 bf_sw/source/ui/inc/dbconfig.hxx create mode 100644 bf_sw/source/ui/inc/edtwin.hxx create mode 100644 bf_sw/source/ui/inc/fldmgr.hxx create mode 100644 bf_sw/source/ui/inc/fontcfg.hxx create mode 100644 bf_sw/source/ui/inc/globals.h create mode 100644 bf_sw/source/ui/inc/globdoc.hrc create mode 100644 bf_sw/source/ui/inc/glshell.hxx create mode 100644 bf_sw/source/ui/inc/misc.hrc create mode 100644 bf_sw/source/ui/inc/modcfg.hxx create mode 100644 bf_sw/source/ui/inc/numpara.hxx create mode 100644 bf_sw/source/ui/inc/popup.hrc create mode 100644 bf_sw/source/ui/inc/prtopt.hxx create mode 100644 bf_sw/source/ui/inc/shells.hrc create mode 100644 bf_sw/source/ui/inc/swcont.hxx create mode 100644 bf_sw/source/ui/inc/swlinguconfig.hxx create mode 100644 bf_sw/source/ui/inc/toolbox.hrc create mode 100644 bf_sw/source/ui/inc/uiitems.hxx create mode 100644 bf_sw/source/ui/inc/uiparam.hxx create mode 100644 bf_sw/source/ui/inc/uitool.hxx create mode 100644 bf_sw/source/ui/inc/usrpref.hxx create mode 100644 bf_sw/source/ui/inc/utlui.hrc create mode 100644 bf_sw/source/ui/inc/web.hrc create mode 100644 bf_sw/source/ui/inc/zoomctrl.hxx create mode 100644 bf_sw/source/ui/index/cnttab.hrc create mode 100644 bf_sw/source/ui/index/index.hrc create mode 100644 bf_sw/source/ui/index/makefile.mk create mode 100644 bf_sw/source/ui/index/sw_cnttab.src create mode 100644 bf_sw/source/ui/index/sw_toxmgr.cxx create mode 100644 bf_sw/source/ui/makefile.mk create mode 100644 bf_sw/source/ui/misc/makefile.mk create mode 100644 bf_sw/source/ui/misc/redlndlg.hrc create mode 100644 bf_sw/source/ui/misc/sw_redlndlg.src create mode 100644 bf_sw/source/ui/shells/makefile.mk create mode 100644 bf_sw/source/ui/shells/sw_pseudo.src create mode 100644 bf_sw/source/ui/shells/sw_shells.src create mode 100644 bf_sw/source/ui/uno/SwXDocumentSettings.hxx create mode 100644 bf_sw/source/ui/uno/SwXPrintPreviewSettings.hxx create mode 100644 bf_sw/source/ui/uno/makefile.mk create mode 100644 bf_sw/source/ui/uno/sw_RefreshListenerContainer.cxx create mode 100644 bf_sw/source/ui/uno/sw_SwXDocumentSettings.cxx create mode 100644 bf_sw/source/ui/uno/sw_SwXFilterOptions.cxx create mode 100644 bf_sw/source/ui/uno/sw_SwXPrintPreviewSettings.cxx create mode 100644 bf_sw/source/ui/uno/sw_unodefaults.cxx create mode 100644 bf_sw/source/ui/uno/sw_unodoc.cxx create mode 100644 bf_sw/source/ui/uno/sw_unofreg.cxx create mode 100644 bf_sw/source/ui/uno/sw_unomod.cxx create mode 100644 bf_sw/source/ui/uno/sw_unotxdoc.cxx create mode 100644 bf_sw/source/ui/uno/unodefaults.hxx create mode 100644 bf_sw/source/ui/utlui/attrdesc.hrc create mode 100644 bf_sw/source/ui/utlui/gloslst.hrc create mode 100644 bf_sw/source/ui/utlui/initui.hrc create mode 100644 bf_sw/source/ui/utlui/makefile.mk create mode 100644 bf_sw/source/ui/utlui/navipi.hrc create mode 100644 bf_sw/source/ui/utlui/sw_attrdesc.cxx create mode 100644 bf_sw/source/ui/utlui/sw_attrdesc.src create mode 100644 bf_sw/source/ui/utlui/sw_gloslst.src create mode 100644 bf_sw/source/ui/utlui/sw_initui.cxx create mode 100644 bf_sw/source/ui/utlui/sw_initui.src create mode 100644 bf_sw/source/ui/utlui/sw_navipi.src create mode 100644 bf_sw/source/ui/utlui/sw_poolfmt.src create mode 100644 bf_sw/source/ui/utlui/sw_uiitems.cxx create mode 100644 bf_sw/source/ui/utlui/sw_uitool.cxx create mode 100644 bf_sw/source/ui/utlui/sw_utlui.src create mode 100644 bf_sw/source/ui/web/makefile.mk create mode 100644 bf_sw/source/ui/web/sw_wdocsh.cxx create mode 100644 bf_sw/util/bf_sw.component create mode 100644 bf_sw/util/bf_sw.map create mode 100644 bf_sw/util/hidother.hrc create mode 100644 bf_sw/util/makefile.mk create mode 100644 bf_sw/util/sw_hidother.src create mode 100644 bf_xmloff/source/chart/MultiPropertySetHandler.hxx create mode 100644 bf_xmloff/source/chart/PropertyMap.hxx create mode 100644 bf_xmloff/source/chart/SchXMLAutoStylePoolP.hxx create mode 100644 bf_xmloff/source/chart/SchXMLChartContext.hxx create mode 100644 bf_xmloff/source/chart/SchXMLParagraphContext.hxx create mode 100644 bf_xmloff/source/chart/SchXMLPlotAreaContext.hxx create mode 100644 bf_xmloff/source/chart/SchXMLTableContext.hxx create mode 100644 bf_xmloff/source/chart/XMLChartPropertyContext.hxx create mode 100644 bf_xmloff/source/chart/XMLErrorIndicatorPropertyHdl.hxx create mode 100644 bf_xmloff/source/chart/XMLSymbolImageContext.hxx create mode 100644 bf_xmloff/source/chart/XMLTextOrientationHdl.hxx create mode 100644 bf_xmloff/source/chart/contexts.hxx create mode 100644 bf_xmloff/source/chart/makefile.mk create mode 100644 bf_xmloff/source/chart/transporttypes.hxx create mode 100644 bf_xmloff/source/chart/xmloff_PropertyMaps.cxx create mode 100644 bf_xmloff/source/chart/xmloff_SchXMLAutoStylePoolP.cxx create mode 100644 bf_xmloff/source/chart/xmloff_SchXMLChartContext.cxx create mode 100644 bf_xmloff/source/chart/xmloff_SchXMLExport.cxx create mode 100644 bf_xmloff/source/chart/xmloff_SchXMLImport.cxx create mode 100644 bf_xmloff/source/chart/xmloff_SchXMLParagraphContext.cxx create mode 100644 bf_xmloff/source/chart/xmloff_SchXMLPlotAreaContext.cxx create mode 100644 bf_xmloff/source/chart/xmloff_SchXMLTableContext.cxx create mode 100644 bf_xmloff/source/chart/xmloff_XMLChartPropertyContext.cxx create mode 100644 bf_xmloff/source/chart/xmloff_XMLChartStyleContext.cxx create mode 100644 bf_xmloff/source/chart/xmloff_XMLErrorIndicatorPropertyHdl.cxx create mode 100644 bf_xmloff/source/chart/xmloff_XMLSymbolImageContext.cxx create mode 100644 bf_xmloff/source/chart/xmloff_XMLTextOrientationHdl.cxx create mode 100644 bf_xmloff/source/chart/xmloff_contexts.cxx create mode 100644 bf_xmloff/source/core/makefile.mk create mode 100644 bf_xmloff/source/core/xmlenums.hxx create mode 100644 bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx create mode 100644 bf_xmloff/source/core/xmloff_ProgressBarHelper.cxx create mode 100644 bf_xmloff/source/core/xmloff_PropertySetMerger.cxx create mode 100644 bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx create mode 100644 bf_xmloff/source/core/xmloff_XMLBase64Export.cxx create mode 100644 bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx create mode 100644 bf_xmloff/source/core/xmloff_XMLBasicExportFilter.cxx create mode 100644 bf_xmloff/source/core/xmloff_XMLEmbeddedObjectExportFilter.cxx create mode 100644 bf_xmloff/source/core/xmloff_XMLEmbeddedObjectImportContext.cxx create mode 100644 bf_xmloff/source/core/xmloff_attrlist.cxx create mode 100644 bf_xmloff/source/core/xmloff_facreg.cxx create mode 100644 bf_xmloff/source/core/xmloff_i18nmap.cxx create mode 100644 bf_xmloff/source/core/xmloff_nmspmap.cxx create mode 100644 bf_xmloff/source/core/xmloff_unoatrcn.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmlcnitm.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmlehelp.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmlerror.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmlexp.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmlictxt.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmlimp.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmlkywd.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmltkmap.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmltoken.cxx create mode 100644 bf_xmloff/source/core/xmloff_xmluconv.cxx create mode 100644 bf_xmloff/source/draw/XMLNumberStylesExport.hxx create mode 100644 bf_xmloff/source/draw/eventimp.hxx create mode 100644 bf_xmloff/source/draw/layerexp.hxx create mode 100644 bf_xmloff/source/draw/layerimp.hxx create mode 100644 bf_xmloff/source/draw/makefile.mk create mode 100644 bf_xmloff/source/draw/numithdl.hxx create mode 100644 bf_xmloff/source/draw/propimp0.hxx create mode 100644 bf_xmloff/source/draw/sdpropls.hxx create mode 100644 bf_xmloff/source/draw/sdxmlexp_impl.hxx create mode 100644 bf_xmloff/source/draw/sdxmlimp_impl.hxx create mode 100644 bf_xmloff/source/draw/ximp3dobject.hxx create mode 100644 bf_xmloff/source/draw/ximp3dscene.hxx create mode 100644 bf_xmloff/source/draw/ximpbody.hxx create mode 100644 bf_xmloff/source/draw/ximpgrp.hxx create mode 100644 bf_xmloff/source/draw/ximpnote.hxx create mode 100644 bf_xmloff/source/draw/ximppage.hxx create mode 100644 bf_xmloff/source/draw/ximpshap.hxx create mode 100644 bf_xmloff/source/draw/ximpshow.hxx create mode 100644 bf_xmloff/source/draw/ximpstyl.hxx create mode 100644 bf_xmloff/source/draw/xmloff_XMLGraphicsDefaultStyle.cxx create mode 100644 bf_xmloff/source/draw/xmloff_XMLImageMapContext.cxx create mode 100644 bf_xmloff/source/draw/xmloff_XMLImageMapExport.cxx create mode 100644 bf_xmloff/source/draw/xmloff_XMLNumberStyles.cxx create mode 100644 bf_xmloff/source/draw/xmloff_XMLShapePropertySetContext.cxx create mode 100644 bf_xmloff/source/draw/xmloff_XMLShapeStyleContext.cxx create mode 100644 bf_xmloff/source/draw/xmloff_animexp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_animimp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_eventimp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_layerexp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_layerimp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_numithdl.cxx create mode 100644 bf_xmloff/source/draw/xmloff_propimp0.cxx create mode 100644 bf_xmloff/source/draw/xmloff_sdpropls.cxx create mode 100644 bf_xmloff/source/draw/xmloff_sdxmlexp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_sdxmlimp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_shapeexport.cxx create mode 100644 bf_xmloff/source/draw/xmloff_shapeexport2.cxx create mode 100644 bf_xmloff/source/draw/xmloff_shapeexport3.cxx create mode 100644 bf_xmloff/source/draw/xmloff_shapeimport.cxx create mode 100644 bf_xmloff/source/draw/xmloff_xexptran.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximp3dobject.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximp3dscene.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximpbody.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximpgrp.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximpnote.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximppage.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximpshap.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximpshow.cxx create mode 100644 bf_xmloff/source/draw/xmloff_ximpstyl.cxx create mode 100644 bf_xmloff/source/forms/attriblistmerge.hxx create mode 100644 bf_xmloff/source/forms/callbacks.hxx create mode 100644 bf_xmloff/source/forms/controlelement.hxx create mode 100644 bf_xmloff/source/forms/controlpropertyhdl.hxx create mode 100644 bf_xmloff/source/forms/controlpropertymap.hxx create mode 100644 bf_xmloff/source/forms/elementexport.hxx create mode 100644 bf_xmloff/source/forms/elementimport.hxx create mode 100644 bf_xmloff/source/forms/elementimport_impl.hxx create mode 100644 bf_xmloff/source/forms/eventexport.hxx create mode 100644 bf_xmloff/source/forms/eventimport.hxx create mode 100644 bf_xmloff/source/forms/formattributes.hxx create mode 100644 bf_xmloff/source/forms/formcellbinding.hxx create mode 100644 bf_xmloff/source/forms/formenums.hxx create mode 100644 bf_xmloff/source/forms/formevents.hxx create mode 100644 bf_xmloff/source/forms/formstyles.hxx create mode 100644 bf_xmloff/source/forms/ifacecompare.hxx create mode 100644 bf_xmloff/source/forms/layerexport.hxx create mode 100644 bf_xmloff/source/forms/layerimport.hxx create mode 100644 bf_xmloff/source/forms/logging.hxx create mode 100644 bf_xmloff/source/forms/makefile.mk create mode 100644 bf_xmloff/source/forms/officeforms.hxx create mode 100644 bf_xmloff/source/forms/propertyexport.hxx create mode 100644 bf_xmloff/source/forms/propertyimport.hxx create mode 100644 bf_xmloff/source/forms/strings.hxx create mode 100644 bf_xmloff/source/forms/valueproperties.hxx create mode 100644 bf_xmloff/source/forms/xmloff_attriblistmerge.cxx create mode 100644 bf_xmloff/source/forms/xmloff_controlelement.cxx create mode 100644 bf_xmloff/source/forms/xmloff_controlpropertyhdl.cxx create mode 100644 bf_xmloff/source/forms/xmloff_controlpropertymap.cxx create mode 100644 bf_xmloff/source/forms/xmloff_elementexport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_elementimport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_eventexport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_eventimport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_formattributes.cxx create mode 100644 bf_xmloff/source/forms/xmloff_formcellbinding.cxx create mode 100644 bf_xmloff/source/forms/xmloff_formenums.cxx create mode 100644 bf_xmloff/source/forms/xmloff_formevents.cxx create mode 100644 bf_xmloff/source/forms/xmloff_formlayerexport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_formlayerimport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_formstyles.cxx create mode 100644 bf_xmloff/source/forms/xmloff_layerexport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_layerimport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_logging.cxx create mode 100644 bf_xmloff/source/forms/xmloff_officeforms.cxx create mode 100644 bf_xmloff/source/forms/xmloff_propertyexport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_propertyimport.cxx create mode 100644 bf_xmloff/source/forms/xmloff_strings.cxx create mode 100644 bf_xmloff/source/forms/xmloff_valueproperties.cxx create mode 100644 bf_xmloff/source/meta/makefile.mk create mode 100644 bf_xmloff/source/meta/xmloff_MetaExportComponent.cxx create mode 100644 bf_xmloff/source/meta/xmloff_MetaImportComponent.cxx create mode 100644 bf_xmloff/source/meta/xmloff_xmlmetae.cxx create mode 100644 bf_xmloff/source/meta/xmloff_xmlmetai.cxx create mode 100644 bf_xmloff/source/script/makefile.mk create mode 100644 bf_xmloff/source/script/xmlbasici.hxx create mode 100644 bf_xmloff/source/script/xmloff_XMLEventExport.cxx create mode 100644 bf_xmloff/source/script/xmloff_XMLEventImportHelper.cxx create mode 100644 bf_xmloff/source/script/xmloff_XMLEventsImportContext.cxx create mode 100644 bf_xmloff/source/script/xmloff_XMLScriptContextFactory.cxx create mode 100644 bf_xmloff/source/script/xmloff_XMLScriptExportHandler.cxx create mode 100644 bf_xmloff/source/script/xmloff_XMLStarBasicContextFactory.cxx create mode 100644 bf_xmloff/source/script/xmloff_XMLStarBasicExportHandler.cxx create mode 100644 bf_xmloff/source/script/xmloff_xmlbasici.cxx create mode 100644 bf_xmloff/source/script/xmloff_xmlscripti.cxx create mode 100644 bf_xmloff/source/style/DrawAspectHdl.hxx create mode 100644 bf_xmloff/source/style/FillStyleContext.hxx create mode 100644 bf_xmloff/source/style/PageHeaderFooterContext.hxx create mode 100644 bf_xmloff/source/style/PageMasterExportPropMapper.hxx create mode 100644 bf_xmloff/source/style/PageMasterImportPropMapper.hxx create mode 100644 bf_xmloff/source/style/PageMasterPropHdl.hxx create mode 100644 bf_xmloff/source/style/PageMasterPropHdlFactory.hxx create mode 100644 bf_xmloff/source/style/PageMasterPropMapper.hxx create mode 100644 bf_xmloff/source/style/PagePropertySetContext.hxx create mode 100644 bf_xmloff/source/style/XMLFootnoteSeparatorExport.hxx create mode 100644 bf_xmloff/source/style/XMLFootnoteSeparatorImport.hxx create mode 100644 bf_xmloff/source/style/adjushdl.hxx create mode 100644 bf_xmloff/source/style/backhdl.hxx create mode 100644 bf_xmloff/source/style/bordrhdl.hxx create mode 100644 bf_xmloff/source/style/breakhdl.hxx create mode 100644 bf_xmloff/source/style/cdouthdl.hxx create mode 100644 bf_xmloff/source/style/chrhghdl.hxx create mode 100644 bf_xmloff/source/style/chrlohdl.hxx create mode 100644 bf_xmloff/source/style/csmaphdl.hxx create mode 100644 bf_xmloff/source/style/durationhdl.hxx create mode 100644 bf_xmloff/source/style/escphdl.hxx create mode 100644 bf_xmloff/source/style/fonthdl.hxx create mode 100644 bf_xmloff/source/style/impastpl.hxx create mode 100644 bf_xmloff/source/style/kernihdl.hxx create mode 100644 bf_xmloff/source/style/lspachdl.hxx create mode 100644 bf_xmloff/source/style/makefile.mk create mode 100644 bf_xmloff/source/style/opaquhdl.hxx create mode 100644 bf_xmloff/source/style/postuhdl.hxx create mode 100644 bf_xmloff/source/style/shadwhdl.hxx create mode 100644 bf_xmloff/source/style/shdwdhdl.hxx create mode 100644 bf_xmloff/source/style/splithdl.hxx create mode 100644 bf_xmloff/source/style/tabsthdl.hxx create mode 100644 bf_xmloff/source/style/undlihdl.hxx create mode 100644 bf_xmloff/source/style/weighhdl.hxx create mode 100644 bf_xmloff/source/style/xmlbahdl.hxx create mode 100644 bf_xmloff/source/style/xmloff_AttributeContainerHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_DashStyle.cxx create mode 100644 bf_xmloff/source/style/xmloff_DrawAspectHdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_EnumPropertyHdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_FillStyleContext.cxx create mode 100644 bf_xmloff/source/style/xmloff_GradientStyle.cxx create mode 100644 bf_xmloff/source/style/xmloff_HatchStyle.cxx create mode 100644 bf_xmloff/source/style/xmloff_ImageStyle.cxx create mode 100644 bf_xmloff/source/style/xmloff_MarkerStyle.cxx create mode 100644 bf_xmloff/source/style/xmloff_MultiPropertySetHelper.cxx create mode 100644 bf_xmloff/source/style/xmloff_NamedBoolPropertyHdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageHeaderFooterContext.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageMasterExportPropMapper.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageMasterImportContext.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageMasterImportPropMapper.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageMasterPropHdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageMasterPropHdlFactory.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageMasterPropMapper.cxx create mode 100644 bf_xmloff/source/style/xmloff_PageMasterStyleMap.cxx create mode 100644 bf_xmloff/source/style/xmloff_PagePropertySetContext.cxx create mode 100644 bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx create mode 100644 bf_xmloff/source/style/xmloff_TransGradientStyle.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLBackgroundImageContext.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLBackgroundImageExport.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLBitmapLogicalSizePropertyHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLBitmapRepeatOffsetPropertyHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLClipPropertyHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLConstantsPropertyHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLElementPropertyContext.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLFillBitmapSizePropertyHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLFontAutoStylePool.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLFontStylesContext.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorExport.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorImport.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLIsPercentagePropertyHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLPageExport.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLPercentOrMeasurePropertyHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_XMLRectangleMembersHandler.cxx create mode 100644 bf_xmloff/source/style/xmloff_adjushdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_backhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_bordrhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_breakhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_cdouthdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_chrhghdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_chrlohdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_csmaphdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_durationhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_escphdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_fonthdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_impastp1.cxx create mode 100644 bf_xmloff/source/style/xmloff_impastp2.cxx create mode 100644 bf_xmloff/source/style/xmloff_impastp3.cxx create mode 100644 bf_xmloff/source/style/xmloff_impastp4.cxx create mode 100644 bf_xmloff/source/style/xmloff_kernihdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_lspachdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_numehelp.cxx create mode 100644 bf_xmloff/source/style/xmloff_opaquhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_postuhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_prhdlfac.cxx create mode 100644 bf_xmloff/source/style/xmloff_prstylei.cxx create mode 100644 bf_xmloff/source/style/xmloff_shadwhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_shdwdhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_splithdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_styleexp.cxx create mode 100644 bf_xmloff/source/style/xmloff_tabsthdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_undlihdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_uniref.cxx create mode 100644 bf_xmloff/source/style/xmloff_weighhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlaustp.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlbahdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlexppr.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlimppr.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlnume.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlnumfe.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlnumfi.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlnumi.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlprcon.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlprhdl.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlprmap.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmlstyle.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmltabe.cxx create mode 100644 bf_xmloff/source/style/xmloff_xmltabi.cxx create mode 100644 bf_xmloff/source/text/XMLAnchorTypePropHdl.hxx create mode 100644 bf_xmloff/source/text/XMLAutoMarkFileContext.hxx create mode 100644 bf_xmloff/source/text/XMLCalculationSettingsContext.hxx create mode 100644 bf_xmloff/source/text/XMLChangeElementImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLChangeImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLChangeInfoContext.hxx create mode 100644 bf_xmloff/source/text/XMLChangedRegionImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLFootnoteBodyImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLFootnoteImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexBibliographyEntryContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexBibliographySourceContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexBodyContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexIllustrationSourceContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexMarkExport.hxx create mode 100644 bf_xmloff/source/text/XMLIndexObjectSourceContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexSimpleEntryContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexSourceBaseContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexSpanEntryContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexTOCContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexTOCSourceContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexTOCStylesContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexTabStopEntryContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexTableSourceContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexTemplateContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexTitleTemplateContext.hxx create mode 100644 bf_xmloff/source/text/XMLIndexUserSourceContext.hxx create mode 100644 bf_xmloff/source/text/XMLLineNumberingExport.hxx create mode 100644 bf_xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLPropertyBackpatcher.hxx create mode 100644 bf_xmloff/source/text/XMLRedlineExport.hxx create mode 100644 bf_xmloff/source/text/XMLSectionExport.hxx create mode 100644 bf_xmloff/source/text/XMLSectionFootnoteConfigExport.hxx create mode 100644 bf_xmloff/source/text/XMLSectionFootnoteConfigImport.hxx create mode 100644 bf_xmloff/source/text/XMLSectionImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLSectionSourceDDEImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLSectionSourceImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLTextCharStyleNamesElementExport.hxx create mode 100644 bf_xmloff/source/text/XMLTextFrameContext.hxx create mode 100644 bf_xmloff/source/text/XMLTextFrameHyperlinkContext.hxx create mode 100644 bf_xmloff/source/text/XMLTextListBlockContext.hxx create mode 100644 bf_xmloff/source/text/XMLTextListItemContext.hxx create mode 100644 bf_xmloff/source/text/XMLTextMarkImportContext.hxx create mode 100644 bf_xmloff/source/text/XMLTextNumRuleInfo.hxx create mode 100644 bf_xmloff/source/text/XMLTextPropertySetContext.hxx create mode 100644 bf_xmloff/source/text/XMLTextShapeImportHelper.hxx create mode 100644 bf_xmloff/source/text/XMLTrackedChangesImportContext.hxx create mode 100644 bf_xmloff/source/text/makefile.mk create mode 100644 bf_xmloff/source/text/txtdrope.hxx create mode 100644 bf_xmloff/source/text/txtdropi.hxx create mode 100644 bf_xmloff/source/text/txtexppr.hxx create mode 100644 bf_xmloff/source/text/txtimppr.hxx create mode 100644 bf_xmloff/source/text/txtparai.hxx create mode 100644 bf_xmloff/source/text/txtprhdl.hxx create mode 100644 bf_xmloff/source/text/xmloff_XMLAutoMarkFileContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLCalculationSettingsContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLChangeElementImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLChangeImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLChangeInfoContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLChangedRegionImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLFootnoteBodyImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLFootnoteConfigurationImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLFootnoteImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexAlphabeticalSourceContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexBibliographyConfigurationContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexBibliographyEntryContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexBibliographySourceContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexBodyContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexChapterInfoEntryContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexIllustrationSourceContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexMarkExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexObjectSourceContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexSimpleEntryContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexSourceBaseContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexSpanEntryContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexTOCContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexTOCSourceContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexTOCStylesContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexTabStopEntryContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexTableSourceContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexTemplateContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexTitleTemplateContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLIndexUserSourceContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLLineNumberingExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLLineNumberingImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLLineNumberingSeparatorImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLPropertyBackpatcher.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLSectionExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigImport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLSectionSourceDDEImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLSectionSourceImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLStringBufferImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextCharStyleNamesElementExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextColumnsContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextColumnsExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextFrameHyperlinkContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextHeaderFooterContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextListAutoStylePool.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextListBlockContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextListItemContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextMarkImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextMasterPageContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextMasterPageExport.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextMasterStylesContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextNumRuleInfo.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextPropertySetContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextShapeImportHelper.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextShapeStyleContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTextTableContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtdrope.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtdropi.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtexppr.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtflde.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtfldi.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtftne.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtimp.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtimppr.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtparae.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtparai.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtprhdl.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtprmap.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtsecte.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtstyle.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtstyli.cxx create mode 100644 bf_xmloff/source/text/xmloff_txtvfldi.cxx create mode 100644 bf_xmloff/util/bf_xo.component create mode 100644 bf_xmloff/util/bf_xo.flt create mode 100644 bf_xmloff/util/exports.dxp create mode 100644 bf_xmloff/util/makefile.mk create mode 100644 binfilterdetect/source/bindet.component create mode 100644 binfilterdetect/source/bindetect.cxx create mode 100644 binfilterdetect/source/bindetect.hxx create mode 100644 binfilterdetect/source/makefile.mk create mode 100644 filter/source/bf_migrate/bf_migrateexports.cxx create mode 100644 filter/source/bf_migrate/bf_migratefilter.component create mode 100644 filter/source/bf_migrate/bf_migratefilter.cxx create mode 100644 filter/source/bf_migrate/bf_migratefilter.hxx create mode 100644 filter/source/bf_migrate/exports.dxp create mode 100644 filter/source/bf_migrate/makefile.mk create mode 100644 filter/source/bf_offwrp/bf_wrapper.component create mode 100644 filter/source/bf_offwrp/bf_wrapper.cxx create mode 100644 filter/source/bf_offwrp/bf_wrapper.hxx create mode 100644 filter/source/bf_offwrp/exports.dxp create mode 100644 filter/source/bf_offwrp/makefile.mk create mode 100644 inc/bf_basic/basmgr.hxx create mode 100644 inc/bf_basic/basrdll.hxx create mode 100644 inc/bf_basic/sb.hxx create mode 100644 inc/bf_basic/sbdef.hxx create mode 100644 inc/bf_basic/sberrors.hxx create mode 100644 inc/bf_basic/sbmeth.hxx create mode 100644 inc/bf_basic/sbmod.hxx create mode 100644 inc/bf_basic/sbprop.hxx create mode 100644 inc/bf_basic/sbstar.hxx create mode 100644 inc/bf_basic/sbx.hxx create mode 100644 inc/bf_basic/sbxbase.hxx create mode 100644 inc/bf_basic/sbxcore.hxx create mode 100644 inc/bf_basic/sbxdef.hxx create mode 100644 inc/bf_basic/sbxfac.hxx create mode 100644 inc/bf_basic/sbxmeth.hxx create mode 100644 inc/bf_basic/sbxobj.hxx create mode 100644 inc/bf_basic/sbxprop.hxx create mode 100644 inc/bf_basic/sbxvar.hxx create mode 100644 inc/bf_goodies/b3dcolor.hxx create mode 100644 inc/bf_goodies/b3dcompo.hxx create mode 100644 inc/bf_goodies/b3dentty.hxx create mode 100644 inc/bf_goodies/b3dgeom.hxx create mode 100644 inc/bf_goodies/b3dlight.hxx create mode 100644 inc/bf_goodies/b3dtex.hxx create mode 100644 inc/bf_goodies/b3dtrans.hxx create mode 100644 inc/bf_goodies/b3dvolum.hxx create mode 100644 inc/bf_goodies/base3d.hxx create mode 100644 inc/bf_goodies/bucket.hxx create mode 100644 inc/bf_goodies/graphicobject.hxx create mode 100644 inc/bf_goodies/hmatrix.hxx create mode 100644 inc/bf_goodies/matril3d.hxx create mode 100644 inc/bf_goodies/matrix3d.hxx create mode 100644 inc/bf_goodies/point3d.hxx create mode 100644 inc/bf_goodies/point4d.hxx create mode 100644 inc/bf_goodies/vector3d.hxx create mode 100644 inc/bf_offmgr/app.hxx create mode 100644 inc/bf_offmgr/ofaids.hrc create mode 100644 inc/bf_sc/ViewSettingsSequenceDefines.hxx create mode 100644 inc/bf_sc/addincol.hxx create mode 100644 inc/bf_sc/afmtuno.hxx create mode 100644 inc/bf_sc/appluno.hxx create mode 100644 inc/bf_sc/appoptio.hxx create mode 100644 inc/bf_sc/arealink.hxx create mode 100644 inc/bf_sc/attarray.hxx create mode 100644 inc/bf_sc/attrib.hxx create mode 100644 inc/bf_sc/autoform.hxx create mode 100644 inc/bf_sc/bclist.hxx create mode 100644 inc/bf_sc/bf_sc.hrc create mode 100644 inc/bf_sc/bigrange.hxx create mode 100644 inc/bf_sc/brdcst.hxx create mode 100644 inc/bf_sc/callform.hxx create mode 100644 inc/bf_sc/cell.hxx create mode 100644 inc/bf_sc/cellform.hxx create mode 100644 inc/bf_sc/cellsuno.hxx create mode 100644 inc/bf_sc/cfgids.hxx create mode 100644 inc/bf_sc/chartarr.hxx create mode 100644 inc/bf_sc/chartlis.hxx create mode 100644 inc/bf_sc/chartuno.hxx create mode 100644 inc/bf_sc/chgtrack.hxx create mode 100644 inc/bf_sc/chgviset.hxx create mode 100644 inc/bf_sc/collect.hxx create mode 100644 inc/bf_sc/column.hxx create mode 100644 inc/bf_sc/compiler.hrc create mode 100644 inc/bf_sc/compiler.hxx create mode 100644 inc/bf_sc/conditio.hxx create mode 100644 inc/bf_sc/confuno.hxx create mode 100644 inc/bf_sc/consoli.hxx create mode 100644 inc/bf_sc/convuno.hxx create mode 100644 inc/bf_sc/cursuno.hxx create mode 100644 inc/bf_sc/dapiuno.hxx create mode 100644 inc/bf_sc/datauno.hxx create mode 100644 inc/bf_sc/dbcolect.hxx create mode 100644 inc/bf_sc/dbdocutl.hxx create mode 100644 inc/bf_sc/dbtoken.hxx create mode 100644 inc/bf_sc/defltuno.hxx create mode 100644 inc/bf_sc/detdata.hxx create mode 100644 inc/bf_sc/detfunc.hxx create mode 100644 inc/bf_sc/dispuno.hxx create mode 100644 inc/bf_sc/dociter.hxx create mode 100644 inc/bf_sc/docoptio.hxx create mode 100644 inc/bf_sc/docpool.hxx create mode 100644 inc/bf_sc/document.hxx create mode 100644 inc/bf_sc/docuno.hxx create mode 100644 inc/bf_sc/dpobject.hxx create mode 100644 inc/bf_sc/dpoutput.hxx create mode 100644 inc/bf_sc/dpsave.hxx create mode 100644 inc/bf_sc/dpsdbtab.hxx create mode 100644 inc/bf_sc/dpshttab.hxx create mode 100644 inc/bf_sc/dptabdat.hxx create mode 100644 inc/bf_sc/dptabres.hxx create mode 100644 inc/bf_sc/dptabsrc.hxx create mode 100644 inc/bf_sc/drawpage.hxx create mode 100644 inc/bf_sc/drdefuno.hxx create mode 100644 inc/bf_sc/drwlayer.hxx create mode 100644 inc/bf_sc/editsrc.hxx create mode 100644 inc/bf_sc/editutil.hxx create mode 100644 inc/bf_sc/eeimport.hxx create mode 100644 inc/bf_sc/eetext.hxx create mode 100644 inc/bf_sc/fielduno.hxx create mode 100644 inc/bf_sc/filter.hxx create mode 100644 inc/bf_sc/filtuno.hxx create mode 100644 inc/bf_sc/fmtuno.hxx create mode 100644 inc/bf_sc/forbiuno.hxx create mode 100644 inc/bf_sc/funcuno.hxx create mode 100644 inc/bf_sc/global.hxx create mode 100644 inc/bf_sc/globstr.hrc create mode 100644 inc/bf_sc/hints.hxx create mode 100644 inc/bf_sc/htmlimp.hxx create mode 100644 inc/bf_sc/indexmap.hxx create mode 100644 inc/bf_sc/inputopt.hxx create mode 100644 inc/bf_sc/linkuno.hxx create mode 100644 inc/bf_sc/markarr.hxx create mode 100644 inc/bf_sc/markdata.hxx create mode 100644 inc/bf_sc/miscuno.hxx create mode 100644 inc/bf_sc/mutexhlp.hxx create mode 100644 inc/bf_sc/nameuno.hxx create mode 100644 inc/bf_sc/navicfg.hxx create mode 100644 inc/bf_sc/notesuno.hxx create mode 100644 inc/bf_sc/olinetab.hxx create mode 100644 inc/bf_sc/opcode.hxx create mode 100644 inc/bf_sc/optuno.hxx create mode 100644 inc/bf_sc/optutil.hxx create mode 100644 inc/bf_sc/pagepar.hxx create mode 100644 inc/bf_sc/pageuno.hxx create mode 100644 inc/bf_sc/patattr.hxx create mode 100644 inc/bf_sc/pivot.hxx create mode 100644 inc/bf_sc/printopt.hxx create mode 100644 inc/bf_sc/prnsave.hxx create mode 100644 inc/bf_sc/progress.hxx create mode 100644 inc/bf_sc/rangelst.hxx create mode 100644 inc/bf_sc/rangenam.hxx create mode 100644 inc/bf_sc/rangeseq.hxx create mode 100644 inc/bf_sc/rangeutl.hxx create mode 100644 inc/bf_sc/rechead.hxx create mode 100644 inc/bf_sc/refdata.hxx create mode 100644 inc/bf_sc/refreshtimer.hxx create mode 100644 inc/bf_sc/rtfimp.hxx create mode 100644 inc/bf_sc/scdll.hxx create mode 100644 inc/bf_sc/scerrors.hxx create mode 100644 inc/bf_sc/scextopt.hxx create mode 100644 inc/bf_sc/scfuncs.hrc create mode 100644 inc/bf_sc/scitems.hxx create mode 100644 inc/bf_sc/sclnlnk.hxx create mode 100644 inc/bf_sc/scmod.hxx create mode 100644 inc/bf_sc/scresid.hxx create mode 100644 inc/bf_sc/scuiks.hxx create mode 100644 inc/bf_sc/servuno.hxx create mode 100644 inc/bf_sc/shapeuno.hxx create mode 100644 inc/bf_sc/shellids.hxx create mode 100644 inc/bf_sc/sortparam.hxx create mode 100644 inc/bf_sc/stlpool.hxx create mode 100644 inc/bf_sc/stlsheet.hxx create mode 100644 inc/bf_sc/strload.hxx create mode 100644 inc/bf_sc/styleuno.hxx create mode 100644 inc/bf_sc/subtotal.hxx create mode 100644 inc/bf_sc/table.hxx create mode 100644 inc/bf_sc/tablink.hxx create mode 100644 inc/bf_sc/tabopparams.hxx create mode 100644 inc/bf_sc/textuno.hxx create mode 100644 inc/bf_sc/token.hxx create mode 100644 inc/bf_sc/unitconv.hxx create mode 100644 inc/bf_sc/unonames.hxx create mode 100644 inc/bf_sc/unowids.hxx create mode 100644 inc/bf_sc/userdat.hxx create mode 100644 inc/bf_sc/userlist.hxx create mode 100644 inc/bf_sc/validat.hxx create mode 100644 inc/bf_sc/viewopti.hxx create mode 100644 inc/bf_sc/viewuno.hxx create mode 100644 inc/bf_sc/zforauto.hxx create mode 100644 inc/bf_sch/ChXChartAxis.hxx create mode 100644 inc/bf_sch/ChXChartDocument.hxx create mode 100644 inc/bf_sch/ReBuildHint.hxx create mode 100644 inc/bf_sch/SchAddInCollection.hxx create mode 100644 inc/bf_sch/adjust.hxx create mode 100644 inc/bf_sch/app.hrc create mode 100644 inc/bf_sch/app.hxx create mode 100644 inc/bf_sch/axisid.hxx create mode 100644 inc/bf_sch/axisobj.hxx create mode 100644 inc/bf_sch/calculat.hxx create mode 100644 inc/bf_sch/cellranges.hxx create mode 100644 inc/bf_sch/chartbar.hxx create mode 100644 inc/bf_sch/charttyp.hxx create mode 100644 inc/bf_sch/chattr.hxx create mode 100644 inc/bf_sch/chaxis.hxx create mode 100644 inc/bf_sch/chdescr.hxx create mode 100644 inc/bf_sch/chmod3d.hxx create mode 100644 inc/bf_sch/chtmodel.hxx create mode 100644 inc/bf_sch/chtscene.hxx create mode 100644 inc/bf_sch/chwindow.hxx create mode 100644 inc/bf_sch/datapoin.hxx create mode 100644 inc/bf_sch/datarow.hxx create mode 100644 inc/bf_sch/defines.hxx create mode 100644 inc/bf_sch/docshell.hxx create mode 100644 inc/bf_sch/eetext.hxx create mode 100644 inc/bf_sch/glob.hrc create mode 100644 inc/bf_sch/glob.hxx create mode 100644 inc/bf_sch/globfunc.hxx create mode 100644 inc/bf_sch/itempool.hxx create mode 100644 inc/bf_sch/mapprov.hxx create mode 100644 inc/bf_sch/memchrt.hxx create mode 100644 inc/bf_sch/modeldata.hxx create mode 100644 inc/bf_sch/objadj.hxx create mode 100644 inc/bf_sch/objfac.hxx create mode 100644 inc/bf_sch/objid.hxx create mode 100644 inc/bf_sch/pairs.hxx create mode 100644 inc/bf_sch/schattr.hxx create mode 100644 inc/bf_sch/schdll.hxx create mode 100644 inc/bf_sch/schdll0.hxx create mode 100644 inc/bf_sch/schgroup.hxx create mode 100644 inc/bf_sch/schiocmp.hxx create mode 100644 inc/bf_sch/schmod.hxx create mode 100644 inc/bf_sch/schopt.hxx create mode 100644 inc/bf_sch/schresid.hxx create mode 100644 inc/bf_sch/schview.hxx create mode 100644 inc/bf_sch/stlpool.hxx create mode 100644 inc/bf_sch/stlsheet.hxx create mode 100644 inc/bf_sch/strings.hrc create mode 100644 inc/bf_sch/unonames.hxx create mode 100644 inc/bf_sd/anminfo.hxx create mode 100644 inc/bf_sd/cusshow.hxx create mode 100644 inc/bf_sd/diadef.h create mode 100644 inc/bf_sd/docshell.hxx create mode 100644 inc/bf_sd/drawdoc.hxx create mode 100644 inc/bf_sd/eetext.hxx create mode 100644 inc/bf_sd/fadedef.h create mode 100644 inc/bf_sd/frmview.hxx create mode 100644 inc/bf_sd/glob.hrc create mode 100644 inc/bf_sd/glob.hxx create mode 100644 inc/bf_sd/grdocsh.hxx create mode 100644 inc/bf_sd/helpids.h create mode 100644 inc/bf_sd/imapinfo.hxx create mode 100644 inc/bf_sd/pres.hxx create mode 100644 inc/bf_sd/sdattr.hxx create mode 100644 inc/bf_sd/sdbinfilter.hxx create mode 100644 inc/bf_sd/sddll.hxx create mode 100644 inc/bf_sd/sderror.hxx create mode 100644 inc/bf_sd/sdfilter.hxx create mode 100644 inc/bf_sd/sdiocmpt.hxx create mode 100644 inc/bf_sd/sdmod.hxx create mode 100644 inc/bf_sd/sdobjfac.hxx create mode 100644 inc/bf_sd/sdoutl.hxx create mode 100644 inc/bf_sd/sdpage.hxx create mode 100644 inc/bf_sd/sdresid.hxx create mode 100644 inc/bf_sd/sduiks.hrc create mode 100644 inc/bf_sd/sdxmlwrp.hxx create mode 100644 inc/bf_sd/stlpool.hxx create mode 100644 inc/bf_sd/stlsheet.hxx create mode 100644 inc/bf_sd/strmname.h create mode 100644 inc/bf_sfx2/app.hxx create mode 100644 inc/bf_sfx2/appuno.hxx create mode 100644 inc/bf_sfx2/arrdecl.hxx create mode 100644 inc/bf_sfx2/bitset.hxx create mode 100644 inc/bf_sfx2/cfgitem.hxx create mode 100644 inc/bf_sfx2/cntids.hrc create mode 100644 inc/bf_sfx2/docfac.hxx create mode 100644 inc/bf_sfx2/docfile.hxx create mode 100644 inc/bf_sfx2/docfilt.hxx create mode 100644 inc/bf_sfx2/docinf.hxx create mode 100644 inc/bf_sfx2/doctempl.hxx create mode 100644 inc/bf_sfx2/event.hxx create mode 100644 inc/bf_sfx2/evntconf.hxx create mode 100644 inc/bf_sfx2/fcontnr.hxx create mode 100644 inc/bf_sfx2/frameobj.hxx create mode 100644 inc/bf_sfx2/frmdescr.hxx create mode 100644 inc/bf_sfx2/genlink.hxx create mode 100644 inc/bf_sfx2/hintpost.hxx create mode 100644 inc/bf_sfx2/interno.hxx create mode 100644 inc/bf_sfx2/macrconf.hxx create mode 100644 inc/bf_sfx2/map.hxx create mode 100644 inc/bf_sfx2/minarray.hxx create mode 100644 inc/bf_sfx2/minstack.hxx create mode 100644 inc/bf_sfx2/misccfg.hxx create mode 100644 inc/bf_sfx2/module.hxx create mode 100644 inc/bf_sfx2/objitem.hxx create mode 100644 inc/bf_sfx2/objsh.hxx create mode 100644 inc/bf_sfx2/objuno.hxx create mode 100644 inc/bf_sfx2/plugobj.hxx create mode 100644 inc/bf_sfx2/printer.hxx create mode 100644 inc/bf_sfx2/progress.hxx create mode 100644 inc/bf_sfx2/request.hxx create mode 100644 inc/bf_sfx2/saveopt.hxx create mode 100644 inc/bf_sfx2/sfx.hrc create mode 100644 inc/bf_sfx2/sfxbasemodel.hxx create mode 100644 inc/bf_sfx2/sfxdefs.hxx create mode 100644 inc/bf_sfx2/sfxsids.hrc create mode 100644 inc/bf_sfx2/sfxuno.hxx create mode 100644 inc/bf_sfx2/shell.hxx create mode 100644 inc/bf_sfx2/srchdefs.hxx create mode 100644 inc/bf_sfx2/srchitem.hxx create mode 100644 inc/bf_sfx2/swap.hxx create mode 100644 inc/bf_sfx2/timestamp.hxx create mode 100644 inc/bf_sfx2/whranges.hxx create mode 100644 inc/bf_so3/applet.hxx create mode 100644 inc/bf_so3/binding.hxx create mode 100644 inc/bf_so3/client.hxx create mode 100644 inc/bf_so3/embobj.hxx create mode 100644 inc/bf_so3/factory.hxx create mode 100644 inc/bf_so3/iface.hxx create mode 100644 inc/bf_so3/inetbnd.hxx create mode 100644 inc/bf_so3/ipclient.hxx create mode 100644 inc/bf_so3/ipenv.hxx create mode 100644 inc/bf_so3/ipobj.hxx create mode 100644 inc/bf_so3/ipwin.hxx create mode 100644 inc/bf_so3/linkmgr.hxx create mode 100644 inc/bf_so3/linksrc.hxx create mode 100644 inc/bf_so3/lnkbase.hxx create mode 100644 inc/bf_so3/outplace.hxx create mode 100644 inc/bf_so3/persist.hxx create mode 100644 inc/bf_so3/plugin.hxx create mode 100644 inc/bf_so3/protocol.hxx create mode 100644 inc/bf_so3/pseudo.hxx create mode 100644 inc/bf_so3/so2defs.hxx create mode 100644 inc/bf_so3/so2dll.hxx create mode 100644 inc/bf_so3/so2ref.hxx create mode 100644 inc/bf_so3/so3dllapi.h create mode 100644 inc/bf_so3/soerr.hxx create mode 100644 inc/bf_so3/staticbaseurl.hxx create mode 100644 inc/bf_so3/svstor.hxx create mode 100644 inc/bf_so3/transbnd.hxx create mode 100644 inc/bf_so3/transprt.hxx create mode 100644 inc/bf_starmath/applicat.hxx create mode 100644 inc/bf_starmath/command.hxx create mode 100644 inc/bf_starmath/config.hxx create mode 100644 inc/bf_starmath/document.hxx create mode 100644 inc/bf_starmath/dynary.hxx create mode 100644 inc/bf_starmath/format.hxx create mode 100644 inc/bf_starmath/node.hxx create mode 100644 inc/bf_starmath/parse.hxx create mode 100644 inc/bf_starmath/rect.hxx create mode 100644 inc/bf_starmath/smdll.hxx create mode 100644 inc/bf_starmath/smdll0.hxx create mode 100644 inc/bf_starmath/smmod.hxx create mode 100644 inc/bf_starmath/starmath.hrc create mode 100644 inc/bf_starmath/symbol.hxx create mode 100644 inc/bf_starmath/types.hxx create mode 100644 inc/bf_starmath/unomodel.hxx create mode 100644 inc/bf_starmath/utility.hxx create mode 100644 inc/bf_svtools/DocumentInfoPreview.hxx create mode 100644 inc/bf_svtools/FilterConfigItem.hxx create mode 100644 inc/bf_svtools/PasswordHelper.hxx create mode 100644 inc/bf_svtools/QueryFolderName.hxx create mode 100644 inc/bf_svtools/addxmltostorageoptions.hxx create mode 100644 inc/bf_svtools/adrparse.hxx create mode 100644 inc/bf_svtools/aeitem.hxx create mode 100644 inc/bf_svtools/apearcfg.hxx create mode 100644 inc/bf_svtools/asynclink.hxx create mode 100644 inc/bf_svtools/bf_postwin.h create mode 100644 inc/bf_svtools/bf_prewin.h create mode 100644 inc/bf_svtools/bf_solar.h create mode 100644 inc/bf_svtools/bintitem.hxx create mode 100644 inc/bf_svtools/brdcst.hxx create mode 100644 inc/bf_svtools/broadcast.hxx create mode 100644 inc/bf_svtools/cacheoptions.hxx create mode 100644 inc/bf_svtools/cancel.hxx create mode 100644 inc/bf_svtools/cenumitm.hxx create mode 100644 inc/bf_svtools/cintitem.hxx create mode 100644 inc/bf_svtools/cjkoptions.hxx create mode 100644 inc/bf_svtools/cmdoptions.hxx create mode 100644 inc/bf_svtools/cnclhint.hxx create mode 100644 inc/bf_svtools/cntnrsrt.hxx create mode 100644 inc/bf_svtools/cntwall.hxx create mode 100644 inc/bf_svtools/cntwids.hrc create mode 100644 inc/bf_svtools/colorcfg.hxx create mode 100644 inc/bf_svtools/compatibility.hxx create mode 100644 inc/bf_svtools/controldims.hrc create mode 100644 inc/bf_svtools/cstitem.hxx create mode 100644 inc/bf_svtools/ctloptions.hxx create mode 100644 inc/bf_svtools/ctrltool.hxx create mode 100644 inc/bf_svtools/ctypeitm.hxx create mode 100644 inc/bf_svtools/custritm.hxx create mode 100644 inc/bf_svtools/dateitem.hxx create mode 100644 inc/bf_svtools/defaultoptions.hxx create mode 100644 inc/bf_svtools/docpasswdrequest.hxx create mode 100644 inc/bf_svtools/dtritem.hxx create mode 100644 inc/bf_svtools/dynamicmenuoptions.hxx create mode 100644 inc/bf_svtools/ehdl.hxx create mode 100644 inc/bf_svtools/eitem.hxx create mode 100644 inc/bf_svtools/expander.hxx create mode 100644 inc/bf_svtools/extendedsecurityoptions.hxx create mode 100644 inc/bf_svtools/filerec.hxx create mode 100644 inc/bf_svtools/fileview.hxx create mode 100644 inc/bf_svtools/filter.hxx create mode 100644 inc/bf_svtools/flagitem.hxx create mode 100644 inc/bf_svtools/flbytes.hxx create mode 100644 inc/bf_svtools/fltcall.hxx create mode 100644 inc/bf_svtools/fltdefs.hxx create mode 100644 inc/bf_svtools/fontoptions.hxx create mode 100644 inc/bf_svtools/frqitem.hxx create mode 100644 inc/bf_svtools/fstathelper.hxx create mode 100644 inc/bf_svtools/gifread.hxx create mode 100644 inc/bf_svtools/globalnameitem.hxx create mode 100644 inc/bf_svtools/helpid.hrc create mode 100644 inc/bf_svtools/helpopt.hxx create mode 100644 inc/bf_svtools/hint.hxx create mode 100644 inc/bf_svtools/historyoptions.hxx create mode 100644 inc/bf_svtools/htmlkywd.hxx create mode 100644 inc/bf_svtools/htmlout.hxx create mode 100644 inc/bf_svtools/htmltokn.h create mode 100644 inc/bf_svtools/idhelper.hxx create mode 100644 inc/bf_svtools/ilstitem.hxx create mode 100644 inc/bf_svtools/imageresourceaccess.hxx create mode 100644 inc/bf_svtools/imap.hxx create mode 100644 inc/bf_svtools/imapcirc.hxx create mode 100644 inc/bf_svtools/imapobj.hxx create mode 100644 inc/bf_svtools/imappoly.hxx create mode 100644 inc/bf_svtools/imaprect.hxx create mode 100644 inc/bf_svtools/imgdef.hxx create mode 100644 inc/bf_svtools/inethist.hxx create mode 100644 inc/bf_svtools/inetimg.hxx create mode 100644 inc/bf_svtools/inetoptions.hxx create mode 100644 inc/bf_svtools/inettype.hxx create mode 100644 inc/bf_svtools/iniadrtk.hxx create mode 100644 inc/bf_svtools/instrm.hxx create mode 100644 inc/bf_svtools/internaloptions.hxx create mode 100644 inc/bf_svtools/intitem.hxx create mode 100644 inc/bf_svtools/iodlg.hrc create mode 100644 inc/bf_svtools/isethint.hxx create mode 100644 inc/bf_svtools/itemiter.hxx create mode 100644 inc/bf_svtools/itempool.hxx create mode 100644 inc/bf_svtools/itemprop.hxx create mode 100644 inc/bf_svtools/itemset.hxx create mode 100644 inc/bf_svtools/javacontext.hxx create mode 100644 inc/bf_svtools/javainteractionhandler.hxx create mode 100644 inc/bf_svtools/jpeg.hxx create mode 100644 inc/bf_svtools/languageoptions.hxx create mode 100644 inc/bf_svtools/lckbitem.hxx create mode 100644 inc/bf_svtools/lingucfg.hxx create mode 100644 inc/bf_svtools/linguprops.hxx create mode 100644 inc/bf_svtools/listener.hxx create mode 100644 inc/bf_svtools/listeneriter.hxx create mode 100644 inc/bf_svtools/lngmisc.hxx create mode 100644 inc/bf_svtools/localisationoptions.hxx create mode 100644 inc/bf_svtools/localresaccess.hxx create mode 100644 inc/bf_svtools/loginerr.hxx create mode 100644 inc/bf_svtools/lstner.hxx create mode 100644 inc/bf_svtools/macitem.hxx create mode 100644 inc/bf_svtools/memberid.hrc create mode 100644 inc/bf_svtools/menuoptions.hxx create mode 100644 inc/bf_svtools/metitem.hxx create mode 100644 inc/bf_svtools/misccfg.hxx create mode 100644 inc/bf_svtools/miscopt.hxx create mode 100644 inc/bf_svtools/moduleoptions.hxx create mode 100644 inc/bf_svtools/msgrd.hxx create mode 100644 inc/bf_svtools/msgwr.hxx create mode 100644 inc/bf_svtools/nfkeytab.hxx create mode 100644 inc/bf_svtools/nfsymbol.hxx create mode 100644 inc/bf_svtools/nfversi.hxx create mode 100644 inc/bf_svtools/nranges.hxx create mode 100644 inc/bf_svtools/numuno.hxx create mode 100644 inc/bf_svtools/ondemand.hxx create mode 100644 inc/bf_svtools/options.hxx create mode 100644 inc/bf_svtools/options3d.hxx create mode 100644 inc/bf_svtools/optionsdlg.hxx create mode 100644 inc/bf_svtools/outstrm.hxx create mode 100644 inc/bf_svtools/ownlist.hxx create mode 100644 inc/bf_svtools/pathoptions.hxx create mode 100644 inc/bf_svtools/pngread.hxx create mode 100644 inc/bf_svtools/poolcach.hxx create mode 100644 inc/bf_svtools/poolitem.hxx create mode 100644 inc/bf_svtools/printoptions.hxx create mode 100644 inc/bf_svtools/printwarningoptions.hxx create mode 100644 inc/bf_svtools/privsplt.hxx create mode 100644 inc/bf_svtools/ptitem.hxx create mode 100644 inc/bf_svtools/rectitem.hxx create mode 100644 inc/bf_svtools/reqitem.hxx create mode 100644 inc/bf_svtools/rngitem.hxx create mode 100644 inc/bf_svtools/saveopt.hxx create mode 100644 inc/bf_svtools/searchopt.hxx create mode 100644 inc/bf_svtools/sectctr.hxx create mode 100644 inc/bf_svtools/section.hxx create mode 100644 inc/bf_svtools/securityoptions.hxx create mode 100644 inc/bf_svtools/sfontitm.hxx create mode 100644 inc/bf_svtools/sfxecode.hxx create mode 100644 inc/bf_svtools/sgfbram.hxx create mode 100644 inc/bf_svtools/sgffilt.hxx create mode 100644 inc/bf_svtools/sgvmain.hxx create mode 100644 inc/bf_svtools/sgvspln.hxx create mode 100644 inc/bf_svtools/slstitm.hxx create mode 100644 inc/bf_svtools/smplhint.hxx create mode 100644 inc/bf_svtools/soerr.hxx create mode 100644 inc/bf_svtools/solar.hrc create mode 100644 inc/bf_svtools/sores.hxx create mode 100644 inc/bf_svtools/sourceviewconfig.hxx create mode 100644 inc/bf_svtools/startoptions.hxx create mode 100644 inc/bf_svtools/stritem.hxx create mode 100644 inc/bf_svtools/strmadpt.hxx create mode 100644 inc/bf_svtools/style.hrc create mode 100644 inc/bf_svtools/style.hxx create mode 100644 inc/bf_svtools/stylepool.hxx create mode 100644 inc/bf_svtools/svarray.hxx create mode 100644 inc/bf_svtools/svdde.hxx create mode 100644 inc/bf_svtools/svicnvw.hxx create mode 100644 inc/bf_svtools/svimpicn.hxx create mode 100644 inc/bf_svtools/svipcdef.h create mode 100644 inc/bf_svtools/svstdarr.hxx create mode 100644 inc/bf_svtools/svtdata.hxx create mode 100644 inc/bf_svtools/svtdllapi.h create mode 100644 inc/bf_svtools/svtool.h create mode 100644 inc/bf_svtools/svtools.hrc create mode 100644 inc/bf_svtools/svtuno.hxx create mode 100644 inc/bf_svtools/syslocale.hxx create mode 100644 inc/bf_svtools/syslocaleoptions.hxx create mode 100644 inc/bf_svtools/szitem.hxx create mode 100644 inc/bf_svtools/templdlg.hxx create mode 100644 inc/bf_svtools/testtool.hxx create mode 100644 inc/bf_svtools/tfrmitem.hxx create mode 100644 inc/bf_svtools/tooltiplbox.hxx create mode 100644 inc/bf_svtools/tresitem.hxx create mode 100644 inc/bf_svtools/ttprops.hxx create mode 100644 inc/bf_svtools/twain.hxx create mode 100644 inc/bf_svtools/undo.hxx create mode 100644 inc/bf_svtools/undoopt.hxx create mode 100644 inc/bf_svtools/unoevent.hxx create mode 100644 inc/bf_svtools/unoimap.hxx create mode 100644 inc/bf_svtools/urihelper.hxx create mode 100644 inc/bf_svtools/urlbmk.hxx create mode 100644 inc/bf_svtools/urlfilter.hxx create mode 100644 inc/bf_svtools/useroptions.hxx create mode 100644 inc/bf_svtools/viewoptions.hxx create mode 100644 inc/bf_svtools/visitem.hxx create mode 100644 inc/bf_svtools/wallitem.hxx create mode 100644 inc/bf_svtools/whiter.hxx create mode 100644 inc/bf_svtools/whmap.hxx create mode 100644 inc/bf_svtools/wmf.hxx create mode 100644 inc/bf_svtools/workingsetoptions.hxx create mode 100644 inc/bf_svtools/xbmread.hxx create mode 100644 inc/bf_svtools/xmlcnimp.hxx create mode 100644 inc/bf_svtools/xmlement.hxx create mode 100644 inc/bf_svtools/xpmread.hxx create mode 100644 inc/bf_svtools/zforfind.hxx create mode 100644 inc/bf_svtools/zforlist.hxx create mode 100644 inc/bf_svtools/zformat.hxx create mode 100644 inc/bf_svx/AccessibleStaticTextBase.hxx create mode 100644 inc/bf_svx/IAccessibleParent.hxx create mode 100644 inc/bf_svx/IAccessibleViewForwarder.hxx create mode 100644 inc/bf_svx/IAccessibleViewForwarderListener.hxx create mode 100644 inc/bf_svx/UnoForbiddenCharsTable.hxx create mode 100644 inc/bf_svx/UnoNamespaceMap.hxx create mode 100644 inc/bf_svx/_fmresid.hrc create mode 100644 inc/bf_svx/adjitem.hxx create mode 100644 inc/bf_svx/adritem.hxx create mode 100644 inc/bf_svx/akrnitem.hxx create mode 100644 inc/bf_svx/algitem.hxx create mode 100644 inc/bf_svx/asiancfg.hxx create mode 100644 inc/bf_svx/blnkitem.hxx create mode 100644 inc/bf_svx/bolnitem.hxx create mode 100644 inc/bf_svx/boxitem.hxx create mode 100644 inc/bf_svx/boxobj.hxx create mode 100644 inc/bf_svx/brkitem.hxx create mode 100644 inc/bf_svx/brshitem.hxx create mode 100644 inc/bf_svx/bulitem.hxx create mode 100644 inc/bf_svx/camera3d.hxx create mode 100644 inc/bf_svx/charreliefitem.hxx create mode 100644 inc/bf_svx/charrotateitem.hxx create mode 100644 inc/bf_svx/charscaleitem.hxx create mode 100644 inc/bf_svx/chrtitem.hxx create mode 100644 inc/bf_svx/clipfmtitem.hxx create mode 100644 inc/bf_svx/cmapitem.hxx create mode 100644 inc/bf_svx/cntritem.hxx create mode 100644 inc/bf_svx/colritem.hxx create mode 100644 inc/bf_svx/crsditem.hxx create mode 100644 inc/bf_svx/cscoitem.hxx create mode 100644 inc/bf_svx/cube3d.hxx create mode 100644 inc/bf_svx/dataaccessdescriptor.hxx create mode 100644 inc/bf_svx/dbaexchange.hxx create mode 100644 inc/bf_svx/dbexch.hrc create mode 100644 inc/bf_svx/def3d.hxx create mode 100644 inc/bf_svx/deflt3d.hxx create mode 100644 inc/bf_svx/dgdefs_.hxx create mode 100644 inc/bf_svx/dialdll.hxx create mode 100644 inc/bf_svx/dialmgr.hxx create mode 100644 inc/bf_svx/dialogs.hrc create mode 100644 inc/bf_svx/dlgutil.hxx create mode 100644 inc/bf_svx/dlight3d.hxx create mode 100644 inc/bf_svx/drawitem.hxx create mode 100644 inc/bf_svx/drawuiks.hxx create mode 100644 inc/bf_svx/e3dcmpt.hxx create mode 100644 inc/bf_svx/e3ditem.hxx create mode 100644 inc/bf_svx/editdata.hxx create mode 100644 inc/bf_svx/editdll.hxx create mode 100644 inc/bf_svx/editeng.hxx create mode 100644 inc/bf_svx/editobj.hxx create mode 100644 inc/bf_svx/editstat.hxx create mode 100644 inc/bf_svx/editund2.hxx create mode 100644 inc/bf_svx/editview.hxx create mode 100644 inc/bf_svx/eeitem.hxx create mode 100644 inc/bf_svx/eeitemid.hxx create mode 100644 inc/bf_svx/eerdll.hxx create mode 100644 inc/bf_svx/emphitem.hxx create mode 100644 inc/bf_svx/escpitem.hxx create mode 100644 inc/bf_svx/extrud3d.hxx create mode 100644 inc/bf_svx/f3dchild.hxx create mode 100644 inc/bf_svx/fhgtitem.hxx create mode 100644 inc/bf_svx/flditem.hxx create mode 100644 inc/bf_svx/float3d.hrc create mode 100644 inc/bf_svx/flstitem.hxx create mode 100644 inc/bf_svx/fmdmod.hxx create mode 100644 inc/bf_svx/fmdpage.hxx create mode 100644 inc/bf_svx/fmglob.hxx create mode 100644 inc/bf_svx/fmgridif.hxx create mode 100644 inc/bf_svx/fmhelp.hrc create mode 100644 inc/bf_svx/fmmodel.hxx create mode 100644 inc/bf_svx/fmobjfac.hxx create mode 100644 inc/bf_svx/fmpage.hxx create mode 100644 inc/bf_svx/fmsearch.hxx create mode 100644 inc/bf_svx/fmshell.hxx create mode 100644 inc/bf_svx/fmview.hxx create mode 100644 inc/bf_svx/fontitem.hxx create mode 100644 inc/bf_svx/forbiddencharacterstable.hxx create mode 100644 inc/bf_svx/forbiddenruleitem.hxx create mode 100644 inc/bf_svx/frmdir.hxx create mode 100644 inc/bf_svx/frmdiritem.hxx create mode 100644 inc/bf_svx/fwdtitem.hxx create mode 100644 inc/bf_svx/gallery.hxx create mode 100644 inc/bf_svx/globl3d.hxx create mode 100644 inc/bf_svx/globlac.hrc create mode 100644 inc/bf_svx/globlmn.hrc create mode 100644 inc/bf_svx/grfcrop.hxx create mode 100644 inc/bf_svx/helpid.hrc create mode 100644 inc/bf_svx/hngpnctitem.hxx create mode 100644 inc/bf_svx/htmlmode.hxx create mode 100644 inc/bf_svx/hyznitem.hxx create mode 100644 inc/bf_svx/ifaceids.hxx create mode 100644 inc/bf_svx/impgrf.hxx create mode 100644 inc/bf_svx/itemdata.hxx create mode 100644 inc/bf_svx/itemtype.hxx create mode 100644 inc/bf_svx/keepitem.hxx create mode 100644 inc/bf_svx/kernitem.hxx create mode 100644 inc/bf_svx/label3d.hxx create mode 100644 inc/bf_svx/langitem.hxx create mode 100644 inc/bf_svx/lathe3d.hxx create mode 100644 inc/bf_svx/light3d.hxx create mode 100644 inc/bf_svx/linkmgr.hxx create mode 100644 inc/bf_svx/lrspitem.hxx create mode 100644 inc/bf_svx/lspcitem.hxx create mode 100644 inc/bf_svx/matrix3d.hxx create mode 100644 inc/bf_svx/mutxhelp.hxx create mode 100644 inc/bf_svx/nhypitem.hxx create mode 100644 inc/bf_svx/nlbkitem.hxx create mode 100644 inc/bf_svx/numdef.hxx create mode 100644 inc/bf_svx/numitem.hxx create mode 100644 inc/bf_svx/obj3d.hxx create mode 100644 inc/bf_svx/objfac3d.hxx create mode 100644 inc/bf_svx/opaqitem.hxx create mode 100644 inc/bf_svx/optgrid.hxx create mode 100644 inc/bf_svx/orphitem.hxx create mode 100644 inc/bf_svx/outliner.hxx create mode 100644 inc/bf_svx/outlobj.hxx create mode 100644 inc/bf_svx/pageitem.hxx create mode 100644 inc/bf_svx/paperinf.hxx create mode 100644 inc/bf_svx/paravertalignitem.hxx create mode 100644 inc/bf_svx/pbinitem.hxx create mode 100644 inc/bf_svx/pgrditem.hxx create mode 100644 inc/bf_svx/plight3d.hxx create mode 100644 inc/bf_svx/pmdlitem.hxx create mode 100644 inc/bf_svx/pntobj3d.hxx create mode 100644 inc/bf_svx/poly3d.hxx create mode 100644 inc/bf_svx/polygn3d.hxx create mode 100644 inc/bf_svx/polyob3d.hxx create mode 100644 inc/bf_svx/polypath.hxx create mode 100644 inc/bf_svx/polysc3d.hxx create mode 100644 inc/bf_svx/postattr.hxx create mode 100644 inc/bf_svx/postitem.hxx create mode 100644 inc/bf_svx/prntitem.hxx create mode 100644 inc/bf_svx/protitem.hxx create mode 100644 inc/bf_svx/prszitem.hxx create mode 100644 inc/bf_svx/rectenum.hxx create mode 100644 inc/bf_svx/rotmodit.hxx create mode 100644 inc/bf_svx/ruler.hxx create mode 100644 inc/bf_svx/rulritem.hxx create mode 100644 inc/bf_svx/scene3d.hxx create mode 100644 inc/bf_svx/scriptspaceitem.hxx create mode 100644 inc/bf_svx/scripttypeitem.hxx create mode 100644 inc/bf_svx/sdangitm.hxx create mode 100644 inc/bf_svx/sdasaitm.hxx create mode 100644 inc/bf_svx/sderitm.hxx create mode 100644 inc/bf_svx/sdgcoitm.hxx create mode 100644 inc/bf_svx/sdgcpitm.hxx create mode 100644 inc/bf_svx/sdggaitm.hxx create mode 100644 inc/bf_svx/sdginitm.hxx create mode 100644 inc/bf_svx/sdgluitm.hxx create mode 100644 inc/bf_svx/sdgmoitm.hxx create mode 100644 inc/bf_svx/sdgrsitm.hxx create mode 100644 inc/bf_svx/sdgtritm.hxx create mode 100644 inc/bf_svx/sdmetitm.hxx create mode 100644 inc/bf_svx/sdmsitm.hxx create mode 100644 inc/bf_svx/sdolsitm.hxx create mode 100644 inc/bf_svx/sdooitm.hxx create mode 100644 inc/bf_svx/sdprcitm.hxx create mode 100644 inc/bf_svx/sdr/properties/attributeproperties.hxx create mode 100644 inc/bf_svx/sdshcitm.hxx create mode 100644 inc/bf_svx/sdshitm.hxx create mode 100644 inc/bf_svx/sdshsitm.hxx create mode 100644 inc/bf_svx/sdshtitm.hxx create mode 100644 inc/bf_svx/sdsxyitm.hxx create mode 100644 inc/bf_svx/sdtaaitm.hxx create mode 100644 inc/bf_svx/sdtacitm.hxx create mode 100644 inc/bf_svx/sdtaditm.hxx create mode 100644 inc/bf_svx/sdtagitm.hxx create mode 100644 inc/bf_svx/sdtaiitm.hxx create mode 100644 inc/bf_svx/sdtaitm.hxx create mode 100644 inc/bf_svx/sdtakitm.hxx create mode 100644 inc/bf_svx/sdtayitm.hxx create mode 100644 inc/bf_svx/sdtcfitm.hxx create mode 100644 inc/bf_svx/sdtditm.hxx create mode 100644 inc/bf_svx/sdtfsitm.hxx create mode 100644 inc/bf_svx/sdtmfitm.hxx create mode 100644 inc/bf_svx/sdynitm.hxx create mode 100644 inc/bf_svx/shaditem.hxx create mode 100644 inc/bf_svx/shdditem.hxx create mode 100644 inc/bf_svx/siimport.hxx create mode 100644 inc/bf_svx/sizeitem.hxx create mode 100644 inc/bf_svx/sjctrl.hxx create mode 100644 inc/bf_svx/sphere3d.hxx create mode 100644 inc/bf_svx/spltitem.hxx create mode 100644 inc/bf_svx/svdattr.hxx create mode 100644 inc/bf_svx/svdattrx.hxx create mode 100644 inc/bf_svx/svdcrtv.hxx create mode 100644 inc/bf_svx/svddef.hxx create mode 100644 inc/bf_svx/svddrgv.hxx create mode 100644 inc/bf_svx/svdedtv.hxx create mode 100644 inc/bf_svx/svdedxv.hxx create mode 100644 inc/bf_svx/svdetc.hxx create mode 100644 inc/bf_svx/svdfield.hxx create mode 100644 inc/bf_svx/svdglev.hxx create mode 100644 inc/bf_svx/svdglob.hxx create mode 100644 inc/bf_svx/svdglue.hxx create mode 100644 inc/bf_svx/svdhdl.hxx create mode 100644 inc/bf_svx/svdhlpln.hxx create mode 100644 inc/bf_svx/svdio.hxx create mode 100644 inc/bf_svx/svditer.hxx create mode 100644 inc/bf_svx/svdlayer.hxx create mode 100644 inc/bf_svx/svdmark.hxx create mode 100644 inc/bf_svx/svdmodel.hxx create mode 100644 inc/bf_svx/svdmrkv.hxx create mode 100644 inc/bf_svx/svdoattr.hxx create mode 100644 inc/bf_svx/svdobj.hxx create mode 100644 inc/bf_svx/svdocapt.hxx create mode 100644 inc/bf_svx/svdocirc.hxx create mode 100644 inc/bf_svx/svdoedge.hxx create mode 100644 inc/bf_svx/svdograf.hxx create mode 100644 inc/bf_svx/svdogrp.hxx create mode 100644 inc/bf_svx/svdomeas.hxx create mode 100644 inc/bf_svx/svdoole2.hxx create mode 100644 inc/bf_svx/svdopage.hxx create mode 100644 inc/bf_svx/svdopath.hxx create mode 100644 inc/bf_svx/svdorect.hxx create mode 100644 inc/bf_svx/svdosmbr.hxx create mode 100644 inc/bf_svx/svdosmev.hxx create mode 100644 inc/bf_svx/svdosmrt.hxx create mode 100644 inc/bf_svx/svdotext.hxx create mode 100644 inc/bf_svx/svdouno.hxx create mode 100644 inc/bf_svx/svdoutl.hxx create mode 100644 inc/bf_svx/svdovirt.hxx create mode 100644 inc/bf_svx/svdpage.hxx create mode 100644 inc/bf_svx/svdpagv.hxx create mode 100644 inc/bf_svx/svdpntv.hxx create mode 100644 inc/bf_svx/svdpoev.hxx create mode 100644 inc/bf_svx/svdpool.hxx create mode 100644 inc/bf_svx/svdshort.hxx create mode 100644 inc/bf_svx/svdsnpv.hxx create mode 100644 inc/bf_svx/svdsob.hxx create mode 100644 inc/bf_svx/svdstr.hrc create mode 100644 inc/bf_svx/svdsuro.hxx create mode 100644 inc/bf_svx/svdtouch.hxx create mode 100644 inc/bf_svx/svdtrans.hxx create mode 100644 inc/bf_svx/svdtypes.hxx create mode 100644 inc/bf_svx/svdundo.hxx create mode 100644 inc/bf_svx/svdview.hxx create mode 100644 inc/bf_svx/svdviter.hxx create mode 100644 inc/bf_svx/svdvmark.hxx create mode 100644 inc/bf_svx/svdxcgv.hxx create mode 100644 inc/bf_svx/svimbase.hxx create mode 100644 inc/bf_svx/svx3ditems.hxx create mode 100644 inc/bf_svx/svxenum.hxx create mode 100644 inc/bf_svx/svxerr.hxx create mode 100644 inc/bf_svx/svxfont.hxx create mode 100644 inc/bf_svx/svxids.hrc create mode 100644 inc/bf_svx/svxitems.hrc create mode 100644 inc/bf_svx/svxslots.hxx create mode 100644 inc/bf_svx/swafopt.hxx create mode 100644 inc/bf_svx/sxallitm.hxx create mode 100644 inc/bf_svx/sxcaitm.hxx create mode 100644 inc/bf_svx/sxcecitm.hxx create mode 100644 inc/bf_svx/sxcgitm.hxx create mode 100644 inc/bf_svx/sxciaitm.hxx create mode 100644 inc/bf_svx/sxcikitm.hxx create mode 100644 inc/bf_svx/sxcisitm.hxx create mode 100644 inc/bf_svx/sxcllitm.hxx create mode 100644 inc/bf_svx/sxcsitm.hxx create mode 100644 inc/bf_svx/sxctitm.hxx create mode 100644 inc/bf_svx/sxekitm.hxx create mode 100644 inc/bf_svx/sxelditm.hxx create mode 100644 inc/bf_svx/sxenditm.hxx create mode 100644 inc/bf_svx/sxesitm.hxx create mode 100644 inc/bf_svx/sxfiitm.hxx create mode 100644 inc/bf_svx/sxlayitm.hxx create mode 100644 inc/bf_svx/sxlogitm.hxx create mode 100644 inc/bf_svx/sxmbritm.hxx create mode 100644 inc/bf_svx/sxmfsitm.hxx create mode 100644 inc/bf_svx/sxmkitm.hxx create mode 100644 inc/bf_svx/sxmlhitm.hxx create mode 100644 inc/bf_svx/sxmoitm.hxx create mode 100644 inc/bf_svx/sxmovitm.hxx create mode 100644 inc/bf_svx/sxmseitm.hxx create mode 100644 inc/bf_svx/sxmsitm.hxx create mode 100644 inc/bf_svx/sxmspitm.hxx create mode 100644 inc/bf_svx/sxmsuitm.hxx create mode 100644 inc/bf_svx/sxmtaitm.hxx create mode 100644 inc/bf_svx/sxmtfitm.hxx create mode 100644 inc/bf_svx/sxmtpitm.hxx create mode 100644 inc/bf_svx/sxmtritm.hxx create mode 100644 inc/bf_svx/sxmuitm.hxx create mode 100644 inc/bf_svx/sxoneitm.hxx create mode 100644 inc/bf_svx/sxonitm.hxx create mode 100644 inc/bf_svx/sxopitm.hxx create mode 100644 inc/bf_svx/sxraitm.hxx create mode 100644 inc/bf_svx/sxreaitm.hxx create mode 100644 inc/bf_svx/sxreoitm.hxx create mode 100644 inc/bf_svx/sxroaitm.hxx create mode 100644 inc/bf_svx/sxrooitm.hxx create mode 100644 inc/bf_svx/sxsaitm.hxx create mode 100644 inc/bf_svx/sxsalitm.hxx create mode 100644 inc/bf_svx/sxsiitm.hxx create mode 100644 inc/bf_svx/sxsoitm.hxx create mode 100644 inc/bf_svx/sxtraitm.hxx create mode 100644 inc/bf_svx/tabline.hxx create mode 100644 inc/bf_svx/tstpitem.hxx create mode 100644 inc/bf_svx/twolinesitem.hxx create mode 100644 inc/bf_svx/txencbox.hxx create mode 100644 inc/bf_svx/txtrange.hxx create mode 100644 inc/bf_svx/ucsubset.hxx create mode 100644 inc/bf_svx/udlnitem.hxx create mode 100644 inc/bf_svx/uiks.hxx create mode 100644 inc/bf_svx/ulspitem.hxx create mode 100644 inc/bf_svx/unoapi.hxx create mode 100644 inc/bf_svx/unoedhlp.hxx create mode 100644 inc/bf_svx/unoedsrc.hxx create mode 100644 inc/bf_svx/unofdesc.hxx create mode 100644 inc/bf_svx/unofield.hxx create mode 100644 inc/bf_svx/unofill.hxx create mode 100644 inc/bf_svx/unofored.hxx create mode 100644 inc/bf_svx/unoforou.hxx create mode 100644 inc/bf_svx/unoipset.hxx create mode 100644 inc/bf_svx/unolingu.hxx create mode 100644 inc/bf_svx/unomaster.hxx create mode 100644 inc/bf_svx/unomid.hxx create mode 100644 inc/bf_svx/unomlstr.hxx create mode 100644 inc/bf_svx/unomod.hxx create mode 100644 inc/bf_svx/unomodel.hxx create mode 100644 inc/bf_svx/unonrule.hxx create mode 100644 inc/bf_svx/unopage.hxx create mode 100644 inc/bf_svx/unopool.hxx create mode 100644 inc/bf_svx/unoprnms.hxx create mode 100644 inc/bf_svx/unoprov.hxx create mode 100644 inc/bf_svx/unoshape.hxx create mode 100644 inc/bf_svx/unoshcol.hxx create mode 100644 inc/bf_svx/unoshprp.hxx create mode 100644 inc/bf_svx/unoshtxt.hxx create mode 100644 inc/bf_svx/unotext.hxx create mode 100644 inc/bf_svx/unoviwed.hxx create mode 100644 inc/bf_svx/unoviwou.hxx create mode 100644 inc/bf_svx/view3d.hxx create mode 100644 inc/bf_svx/viewpt3d.hxx create mode 100644 inc/bf_svx/volume3d.hxx create mode 100644 inc/bf_svx/wghtitem.hxx create mode 100644 inc/bf_svx/widwitem.hxx create mode 100644 inc/bf_svx/writingmodeitem.hxx create mode 100644 inc/bf_svx/wrlmitem.hxx create mode 100644 inc/bf_svx/xattr.hxx create mode 100644 inc/bf_svx/xbitmap.hxx create mode 100644 inc/bf_svx/xbtmpit.hxx create mode 100644 inc/bf_svx/xcolit.hxx create mode 100644 inc/bf_svx/xdash.hxx create mode 100644 inc/bf_svx/xdef.hxx create mode 100644 inc/bf_svx/xenum.hxx create mode 100644 inc/bf_svx/xfillit.hxx create mode 100644 inc/bf_svx/xfillit0.hxx create mode 100644 inc/bf_svx/xflasit.hxx create mode 100644 inc/bf_svx/xflbckit.hxx create mode 100644 inc/bf_svx/xflbmpit.hxx create mode 100644 inc/bf_svx/xflbmsli.hxx create mode 100644 inc/bf_svx/xflbmsxy.hxx create mode 100644 inc/bf_svx/xflbmtit.hxx create mode 100644 inc/bf_svx/xflboxy.hxx create mode 100644 inc/bf_svx/xflbstit.hxx create mode 100644 inc/bf_svx/xflbtoxy.hxx create mode 100644 inc/bf_svx/xflclit.hxx create mode 100644 inc/bf_svx/xflftrit.hxx create mode 100644 inc/bf_svx/xflgrit.hxx create mode 100644 inc/bf_svx/xflhtit.hxx create mode 100644 inc/bf_svx/xfltrit.hxx create mode 100644 inc/bf_svx/xftadit.hxx create mode 100644 inc/bf_svx/xftdiit.hxx create mode 100644 inc/bf_svx/xftmrit.hxx create mode 100644 inc/bf_svx/xftouit.hxx create mode 100644 inc/bf_svx/xftsfit.hxx create mode 100644 inc/bf_svx/xftshcit.hxx create mode 100644 inc/bf_svx/xftshit.hxx create mode 100644 inc/bf_svx/xftshtit.hxx create mode 100644 inc/bf_svx/xftshxy.hxx create mode 100644 inc/bf_svx/xftstit.hxx create mode 100644 inc/bf_svx/xgrad.hxx create mode 100644 inc/bf_svx/xgrscit.hxx create mode 100644 inc/bf_svx/xhatch.hxx create mode 100644 inc/bf_svx/xiocomp.hxx create mode 100644 inc/bf_svx/xit.hxx create mode 100644 inc/bf_svx/xlineit.hxx create mode 100644 inc/bf_svx/xlineit0.hxx create mode 100644 inc/bf_svx/xlinjoit.hxx create mode 100644 inc/bf_svx/xlnasit.hxx create mode 100644 inc/bf_svx/xlnclit.hxx create mode 100644 inc/bf_svx/xlndsit.hxx create mode 100644 inc/bf_svx/xlnedcit.hxx create mode 100644 inc/bf_svx/xlnedit.hxx create mode 100644 inc/bf_svx/xlnedwit.hxx create mode 100644 inc/bf_svx/xlnstcit.hxx create mode 100644 inc/bf_svx/xlnstit.hxx create mode 100644 inc/bf_svx/xlnstwit.hxx create mode 100644 inc/bf_svx/xlntrit.hxx create mode 100644 inc/bf_svx/xlnwtit.hxx create mode 100644 inc/bf_svx/xmlcnitm.hxx create mode 100644 inc/bf_svx/xmleohlp.hxx create mode 100644 inc/bf_svx/xmlgrhlp.hxx create mode 100644 inc/bf_svx/xoutbmp.hxx create mode 100644 inc/bf_svx/xoutx.hxx create mode 100644 inc/bf_svx/xpoly.hxx create mode 100644 inc/bf_svx/xpolyimp.hxx create mode 100644 inc/bf_svx/xpool.hxx create mode 100644 inc/bf_svx/xtable.hxx create mode 100644 inc/bf_svx/xtextit0.hxx create mode 100644 inc/bf_svx/xtxasit.hxx create mode 100644 inc/bf_svx/zoomitem.hxx create mode 100644 inc/bf_sw/RefreshListenerContainer.hxx create mode 100644 inc/bf_sw/SwGetPoolIdFromName.hxx create mode 100644 inc/bf_sw/SwStyleNameMapper.hxx create mode 100644 inc/bf_sw/TextCursorHelper.hxx create mode 100644 inc/bf_sw/access.hrc create mode 100644 inc/bf_sw/accessibilityoptions.hxx create mode 100644 inc/bf_sw/acmplwrd.hxx create mode 100644 inc/bf_sw/authfld.hxx create mode 100644 inc/bf_sw/authratr.hxx create mode 100644 inc/bf_sw/bkmrke.hxx create mode 100644 inc/bf_sw/bookmrk.hxx create mode 100644 inc/bf_sw/bparr.hxx create mode 100644 inc/bf_sw/breakit.hxx create mode 100644 inc/bf_sw/calbck.hxx create mode 100644 inc/bf_sw/calc.hxx create mode 100644 inc/bf_sw/cellatr.hxx create mode 100644 inc/bf_sw/cellfml.hxx create mode 100644 inc/bf_sw/charatr.hxx create mode 100644 inc/bf_sw/charfmt.hxx create mode 100644 inc/bf_sw/chcmprse.hxx create mode 100644 inc/bf_sw/checkit.hxx create mode 100644 inc/bf_sw/chpfld.hxx create mode 100644 inc/bf_sw/cmdid.h create mode 100644 inc/bf_sw/comcore.hrc create mode 100644 inc/bf_sw/crsrsh.hxx create mode 100644 inc/bf_sw/crsskip.hxx create mode 100644 inc/bf_sw/crstate.hxx create mode 100644 inc/bf_sw/cshtyp.hxx create mode 100644 inc/bf_sw/dbfld.hxx create mode 100644 inc/bf_sw/dbmgr.hxx create mode 100644 inc/bf_sw/dcontact.hxx create mode 100644 inc/bf_sw/ddefld.hxx create mode 100644 inc/bf_sw/dlelstnr.hxx create mode 100644 inc/bf_sw/dobjfac.hxx create mode 100644 inc/bf_sw/doc.hxx create mode 100644 inc/bf_sw/docary.hxx create mode 100644 inc/bf_sw/docfac.hxx create mode 100644 inc/bf_sw/docsh.hxx create mode 100644 inc/bf_sw/docstat.hxx create mode 100644 inc/bf_sw/docstyle.hxx create mode 100644 inc/bf_sw/docufld.hxx create mode 100644 inc/bf_sw/dpage.hxx create mode 100644 inc/bf_sw/drawdoc.hxx create mode 100644 inc/bf_sw/editsh.hxx create mode 100644 inc/bf_sw/expfld.hxx create mode 100644 inc/bf_sw/extinput.hxx create mode 100644 inc/bf_sw/fchrfmt.hxx create mode 100644 inc/bf_sw/fesh.hxx create mode 100644 inc/bf_sw/fldbas.hxx create mode 100644 inc/bf_sw/flddat.hxx create mode 100644 inc/bf_sw/flddropdown.hxx create mode 100644 inc/bf_sw/fldupde.hxx create mode 100644 inc/bf_sw/flyenum.hxx create mode 100644 inc/bf_sw/fmtanchr.hxx create mode 100644 inc/bf_sw/fmtclbl.hxx create mode 100644 inc/bf_sw/fmtclds.hxx create mode 100644 inc/bf_sw/fmtcnct.hxx create mode 100644 inc/bf_sw/fmtcntnt.hxx create mode 100644 inc/bf_sw/fmtcol.hxx create mode 100644 inc/bf_sw/fmteiro.hxx create mode 100644 inc/bf_sw/fmtflcnt.hxx create mode 100644 inc/bf_sw/fmtfld.hxx create mode 100644 inc/bf_sw/fmtfordr.hxx create mode 100644 inc/bf_sw/fmtfsize.hxx create mode 100644 inc/bf_sw/fmtftn.hxx create mode 100644 inc/bf_sw/fmtftntx.hxx create mode 100644 inc/bf_sw/fmthbsh.hxx create mode 100644 inc/bf_sw/fmthdft.hxx create mode 100644 inc/bf_sw/fmtinfmt.hxx create mode 100644 inc/bf_sw/fmtline.hxx create mode 100644 inc/bf_sw/fmtlsplt.hxx create mode 100644 inc/bf_sw/fmtornt.hxx create mode 100644 inc/bf_sw/fmtpdsc.hxx create mode 100644 inc/bf_sw/fmtrfmrk.hxx create mode 100644 inc/bf_sw/fmtruby.hxx create mode 100644 inc/bf_sw/fmtsrnd.hxx create mode 100644 inc/bf_sw/fmturl.hxx create mode 100644 inc/bf_sw/format.hxx create mode 100644 inc/bf_sw/frmatr.hxx create mode 100644 inc/bf_sw/frmfmt.hxx create mode 100644 inc/bf_sw/ftnidx.hxx create mode 100644 inc/bf_sw/ftninfo.hxx create mode 100644 inc/bf_sw/globals.hrc create mode 100644 inc/bf_sw/globdoc.hxx create mode 100644 inc/bf_sw/grfatr.hxx create mode 100644 inc/bf_sw/helpid.h create mode 100644 inc/bf_sw/hfspacingitem.hxx create mode 100644 inc/bf_sw/hintids.hxx create mode 100644 inc/bf_sw/hints.hxx create mode 100644 inc/bf_sw/horiornt.hxx create mode 100644 inc/bf_sw/index.hxx create mode 100644 inc/bf_sw/inetfld.hxx create mode 100644 inc/bf_sw/init.hxx create mode 100644 inc/bf_sw/io.hxx create mode 100644 inc/bf_sw/iodetect.hxx create mode 100644 inc/bf_sw/itabenum.hxx create mode 100644 inc/bf_sw/lineinfo.hxx create mode 100644 inc/bf_sw/linetype.hxx create mode 100644 inc/bf_sw/linkenum.hxx create mode 100644 inc/bf_sw/mdiexp.hxx create mode 100644 inc/bf_sw/ndarr.hxx create mode 100644 inc/bf_sw/ndgrf.hxx create mode 100644 inc/bf_sw/ndhints.hxx create mode 100644 inc/bf_sw/ndindex.hxx create mode 100644 inc/bf_sw/ndnotxt.hxx create mode 100644 inc/bf_sw/ndole.hxx create mode 100644 inc/bf_sw/ndtxt.hxx create mode 100644 inc/bf_sw/ndtyp.hxx create mode 100644 inc/bf_sw/newhdl.hxx create mode 100644 inc/bf_sw/node.hxx create mode 100644 inc/bf_sw/numrule.hxx create mode 100644 inc/bf_sw/orntenum.hxx create mode 100644 inc/bf_sw/pagedesc.hxx create mode 100644 inc/bf_sw/pam.hxx create mode 100644 inc/bf_sw/paratr.hxx create mode 100644 inc/bf_sw/poolfmt.awk create mode 100644 inc/bf_sw/poolfmt.hrc create mode 100644 inc/bf_sw/poolfmt.hxx create mode 100644 inc/bf_sw/printdata.hxx create mode 100644 inc/bf_sw/pvprtdat.hxx create mode 100644 inc/bf_sw/rcid.hrc create mode 100644 inc/bf_sw/redlenum.hxx create mode 100644 inc/bf_sw/redline.hxx create mode 100644 inc/bf_sw/redlnaut.hxx create mode 100644 inc/bf_sw/reffld.hxx create mode 100644 inc/bf_sw/ring.hxx create mode 100644 inc/bf_sw/rubylist.hxx create mode 100644 inc/bf_sw/section.hxx create mode 100644 inc/bf_sw/shellid.hxx create mode 100644 inc/bf_sw/shellio.hxx create mode 100644 inc/bf_sw/shellres.hxx create mode 100644 inc/bf_sw/sortopt.hxx create mode 100644 inc/bf_sw/statstr.hrc create mode 100644 inc/bf_sw/sw.mk create mode 100644 inc/bf_sw/sw3io.hxx create mode 100644 inc/bf_sw/swatrset.hxx create mode 100644 inc/bf_sw/swbaslnk.hxx create mode 100644 inc/bf_sw/swcalwrp.hxx create mode 100644 inc/bf_sw/swcrsr.hxx create mode 100644 inc/bf_sw/swdbdata.hxx create mode 100644 inc/bf_sw/swddetbl.hxx create mode 100644 inc/bf_sw/swdll.hxx create mode 100644 inc/bf_sw/swerror.h create mode 100644 inc/bf_sw/swevent.hxx create mode 100644 inc/bf_sw/swfltopt.hxx create mode 100644 inc/bf_sw/swgpar.hxx create mode 100644 inc/bf_sw/swgstr.hxx create mode 100644 inc/bf_sw/swhints.hxx create mode 100644 inc/bf_sw/swmodule.hxx create mode 100644 inc/bf_sw/swpre.mk create mode 100644 inc/bf_sw/swprtopt.hxx create mode 100644 inc/bf_sw/swrect.hxx create mode 100644 inc/bf_sw/swregion.hxx create mode 100644 inc/bf_sw/swserv.hxx create mode 100644 inc/bf_sw/swstyle.h create mode 100644 inc/bf_sw/swtable.hxx create mode 100644 inc/bf_sw/swtblfmt.hxx create mode 100644 inc/bf_sw/swtypes.hxx create mode 100644 inc/bf_sw/swunodef.hxx create mode 100644 inc/bf_sw/swunohelper.hxx create mode 100644 inc/bf_sw/swwait.hxx create mode 100644 inc/bf_sw/tabcol.hxx create mode 100644 inc/bf_sw/tblafmt.hxx create mode 100644 inc/bf_sw/tblenum.hxx create mode 100644 inc/bf_sw/tblsel.hxx create mode 100644 inc/bf_sw/tgrditem.hxx create mode 100644 inc/bf_sw/tox.hxx create mode 100644 inc/bf_sw/toxe.hxx create mode 100644 inc/bf_sw/toxwrap.hxx create mode 100644 inc/bf_sw/txatbase.hxx create mode 100644 inc/bf_sw/txatritr.hxx create mode 100644 inc/bf_sw/txtatr.hxx create mode 100644 inc/bf_sw/txtflcnt.hxx create mode 100644 inc/bf_sw/txtfld.hxx create mode 100644 inc/bf_sw/txtftn.hxx create mode 100644 inc/bf_sw/txtinet.hxx create mode 100644 inc/bf_sw/txtrfmrk.hxx create mode 100644 inc/bf_sw/txttxmrk.hxx create mode 100644 inc/bf_sw/undobj.hxx create mode 100644 inc/bf_sw/unoatxt.hxx create mode 100644 inc/bf_sw/unobaseclass.hxx create mode 100644 inc/bf_sw/unocoll.hxx create mode 100644 inc/bf_sw/unocrsr.hxx create mode 100644 inc/bf_sw/unocrsrhelper.hxx create mode 100644 inc/bf_sw/unodraw.hxx create mode 100644 inc/bf_sw/unoevent.hxx create mode 100644 inc/bf_sw/unoevtlstnr.hxx create mode 100644 inc/bf_sw/unofield.hxx create mode 100644 inc/bf_sw/unoframe.hxx create mode 100644 inc/bf_sw/unoidx.hxx create mode 100644 inc/bf_sw/unomailmerge.hxx create mode 100644 inc/bf_sw/unomap.hxx create mode 100644 inc/bf_sw/unomid.h create mode 100644 inc/bf_sw/unomod.hxx create mode 100644 inc/bf_sw/unoobj.hxx create mode 100644 inc/bf_sw/unoport.hxx create mode 100644 inc/bf_sw/unoprnms.hxx create mode 100644 inc/bf_sw/unoredline.hxx create mode 100644 inc/bf_sw/unoredlines.hxx create mode 100644 inc/bf_sw/unosett.hxx create mode 100644 inc/bf_sw/unosrch.hxx create mode 100644 inc/bf_sw/unostyle.hxx create mode 100644 inc/bf_sw/unotbl.hxx create mode 100644 inc/bf_sw/unotxdoc.hxx create mode 100644 inc/bf_sw/usrfld.hxx create mode 100644 inc/bf_sw/viewopt.hxx create mode 100644 inc/bf_sw/viewsh.hxx create mode 100644 inc/bf_sw/viscrs.hxx create mode 100644 inc/bf_sw/wdocsh.hxx create mode 100644 inc/bf_tools/contnr.hxx create mode 100644 inc/bf_tools/impcont.hxx create mode 100644 inc/bf_tools/ownlist.hxx create mode 100644 inc/bf_tools/stack.hxx create mode 100644 inc/bf_tools/string.hxx create mode 100644 inc/bf_tools/unqid.hxx create mode 100644 inc/bf_tools/unqidx.hxx create mode 100644 inc/bf_xmloff/AttributeContainerHandler.hxx create mode 100644 inc/bf_xmloff/ControlBorderHandler.hxx create mode 100644 inc/bf_xmloff/DashStyle.hxx create mode 100644 inc/bf_xmloff/DocumentSettingsContext.hxx create mode 100644 inc/bf_xmloff/EnumPropertyHdl.hxx create mode 100644 inc/bf_xmloff/GradientStyle.hxx create mode 100644 inc/bf_xmloff/HatchStyle.hxx create mode 100644 inc/bf_xmloff/ImageStyle.hxx create mode 100644 inc/bf_xmloff/MarkerStyle.hxx create mode 100644 inc/bf_xmloff/MetaExportComponent.hxx create mode 100644 inc/bf_xmloff/MetaImportComponent.hxx create mode 100644 inc/bf_xmloff/MultiPropertySetHelper.hxx create mode 100644 inc/bf_xmloff/NamedBoolPropertyHdl.hxx create mode 100644 inc/bf_xmloff/PageMasterImportContext.hxx create mode 100644 inc/bf_xmloff/PageMasterStyleMap.hxx create mode 100644 inc/bf_xmloff/ProgressBarHelper.hxx create mode 100644 inc/bf_xmloff/PropertySetInfoHash.hxx create mode 100644 inc/bf_xmloff/PropertySetInfoKey.hxx create mode 100644 inc/bf_xmloff/PropertySetMerger.hxx create mode 100644 inc/bf_xmloff/SchXMLExport.hxx create mode 100644 inc/bf_xmloff/SchXMLExportHelper.hxx create mode 100644 inc/bf_xmloff/SchXMLImport.hxx create mode 100644 inc/bf_xmloff/SchXMLImportHelper.hxx create mode 100644 inc/bf_xmloff/SettingsExportHelper.hxx create mode 100644 inc/bf_xmloff/SinglePropertySetInfoCache.hxx create mode 100644 inc/bf_xmloff/TransGradientStyle.hxx create mode 100644 inc/bf_xmloff/XMLBackgroundImageContext.hxx create mode 100644 inc/bf_xmloff/XMLBackgroundImageExport.hxx create mode 100644 inc/bf_xmloff/XMLBase64Export.hxx create mode 100644 inc/bf_xmloff/XMLBase64ImportContext.hxx create mode 100644 inc/bf_xmloff/XMLBasicExportFilter.hxx create mode 100644 inc/bf_xmloff/XMLBitmapLogicalSizePropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLBitmapRepeatOffsetPropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLChartPropertySetMapper.hxx create mode 100644 inc/bf_xmloff/XMLChartStyleContext.hxx create mode 100644 inc/bf_xmloff/XMLClipPropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLConstantsPropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLElementPropertyContext.hxx create mode 100644 inc/bf_xmloff/XMLEmbeddedObjectExportFilter.hxx create mode 100644 inc/bf_xmloff/XMLEmbeddedObjectImportContext.hxx create mode 100644 inc/bf_xmloff/XMLEventExport.hxx create mode 100644 inc/bf_xmloff/XMLEventImportHelper.hxx create mode 100644 inc/bf_xmloff/XMLEventsImportContext.hxx create mode 100644 inc/bf_xmloff/XMLFillBitmapSizePropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLFilterServiceNames.h create mode 100644 inc/bf_xmloff/XMLFontAutoStylePool.hxx create mode 100644 inc/bf_xmloff/XMLFontStylesContext.hxx create mode 100644 inc/bf_xmloff/XMLFootnoteConfigurationImportContext.hxx create mode 100644 inc/bf_xmloff/XMLGraphicsDefaultStyle.hxx create mode 100644 inc/bf_xmloff/XMLImageMapContext.hxx create mode 100644 inc/bf_xmloff/XMLImageMapExport.hxx create mode 100644 inc/bf_xmloff/XMLIndexBibliographyConfigurationContext.hxx create mode 100644 inc/bf_xmloff/XMLIsPercentagePropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLLineNumberingImportContext.hxx create mode 100644 inc/bf_xmloff/XMLNumberStylesImport.hxx create mode 100644 inc/bf_xmloff/XMLPageExport.hxx create mode 100644 inc/bf_xmloff/XMLPercentOrMeasurePropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLRectangleMembersHandler.hxx create mode 100644 inc/bf_xmloff/XMLScriptContextFactory.hxx create mode 100644 inc/bf_xmloff/XMLScriptExportHandler.hxx create mode 100644 inc/bf_xmloff/XMLShapePropertySetContext.hxx create mode 100644 inc/bf_xmloff/XMLShapeStyleContext.hxx create mode 100644 inc/bf_xmloff/XMLStarBasicContextFactory.hxx create mode 100644 inc/bf_xmloff/XMLStarBasicExportHandler.hxx create mode 100644 inc/bf_xmloff/XMLStringBufferImportContext.hxx create mode 100644 inc/bf_xmloff/XMLTextColumnsContext.hxx create mode 100644 inc/bf_xmloff/XMLTextColumnsExport.hxx create mode 100644 inc/bf_xmloff/XMLTextColumnsPropertyHandler.hxx create mode 100644 inc/bf_xmloff/XMLTextHeaderFooterContext.hxx create mode 100644 inc/bf_xmloff/XMLTextListAutoStylePool.hxx create mode 100644 inc/bf_xmloff/XMLTextMasterPageContext.hxx create mode 100644 inc/bf_xmloff/XMLTextMasterPageExport.hxx create mode 100644 inc/bf_xmloff/XMLTextMasterStylesContext.hxx create mode 100644 inc/bf_xmloff/XMLTextShapeImportHelper.hxx create mode 100644 inc/bf_xmloff/XMLTextShapeStyleContext.hxx create mode 100644 inc/bf_xmloff/XMLTextTableContext.hxx create mode 100644 inc/bf_xmloff/anim.hxx create mode 100644 inc/bf_xmloff/animexp.hxx create mode 100644 inc/bf_xmloff/animimp.hxx create mode 100644 inc/bf_xmloff/attrlist.hxx create mode 100644 inc/bf_xmloff/contextid.hxx create mode 100644 inc/bf_xmloff/families.hxx create mode 100644 inc/bf_xmloff/formlayerexport.hxx create mode 100644 inc/bf_xmloff/formlayerimport.hxx create mode 100644 inc/bf_xmloff/functional.hxx create mode 100644 inc/bf_xmloff/i18nmap.hxx create mode 100644 inc/bf_xmloff/maptype.hxx create mode 100644 inc/bf_xmloff/nmspmap.hxx create mode 100644 inc/bf_xmloff/numehelp.hxx create mode 100644 inc/bf_xmloff/prhdlfac.hxx create mode 100644 inc/bf_xmloff/prstylei.hxx create mode 100644 inc/bf_xmloff/sdxmlexp.hxx create mode 100644 inc/bf_xmloff/sdxmlimp.hxx create mode 100644 inc/bf_xmloff/shapeexport.hxx create mode 100644 inc/bf_xmloff/shapeimport.hxx create mode 100644 inc/bf_xmloff/styleexp.hxx create mode 100644 inc/bf_xmloff/txtflde.hxx create mode 100644 inc/bf_xmloff/txtfldi.hxx create mode 100644 inc/bf_xmloff/txtimp.hxx create mode 100644 inc/bf_xmloff/txtparae.hxx create mode 100644 inc/bf_xmloff/txtprmap.hxx create mode 100644 inc/bf_xmloff/txtstyle.hxx create mode 100644 inc/bf_xmloff/txtstyli.hxx create mode 100644 inc/bf_xmloff/txtvfldi.hxx create mode 100644 inc/bf_xmloff/uniref.hxx create mode 100644 inc/bf_xmloff/unoatrcn.hxx create mode 100644 inc/bf_xmloff/xexptran.hxx create mode 100644 inc/bf_xmloff/xmlaustp.hxx create mode 100644 inc/bf_xmloff/xmlcnimp.hxx create mode 100644 inc/bf_xmloff/xmlcnitm.hxx create mode 100644 inc/bf_xmloff/xmlehelp.hxx create mode 100644 inc/bf_xmloff/xmlement.hxx create mode 100644 inc/bf_xmloff/xmlerror.hxx create mode 100644 inc/bf_xmloff/xmlevent.hxx create mode 100644 inc/bf_xmloff/xmlexp.hxx create mode 100644 inc/bf_xmloff/xmlexppr.hxx create mode 100644 inc/bf_xmloff/xmlictxt.hxx create mode 100644 inc/bf_xmloff/xmlimp.hxx create mode 100644 inc/bf_xmloff/xmlimppr.hxx create mode 100644 inc/bf_xmloff/xmlkywd.hxx create mode 100644 inc/bf_xmloff/xmlmetae.hxx create mode 100644 inc/bf_xmloff/xmlmetai.hxx create mode 100644 inc/bf_xmloff/xmlnmspe.hxx create mode 100644 inc/bf_xmloff/xmlnume.hxx create mode 100644 inc/bf_xmloff/xmlnumfe.hxx create mode 100644 inc/bf_xmloff/xmlnumfi.hxx create mode 100644 inc/bf_xmloff/xmlnumi.hxx create mode 100644 inc/bf_xmloff/xmlprcon.hxx create mode 100644 inc/bf_xmloff/xmlprhdl.hxx create mode 100644 inc/bf_xmloff/xmlprmap.hxx create mode 100644 inc/bf_xmloff/xmlreg.hxx create mode 100644 inc/bf_xmloff/xmlscripti.hxx create mode 100644 inc/bf_xmloff/xmlstyle.hxx create mode 100644 inc/bf_xmloff/xmltabe.hxx create mode 100644 inc/bf_xmloff/xmltabi.hxx create mode 100644 inc/bf_xmloff/xmltkmap.hxx create mode 100644 inc/bf_xmloff/xmltoken.hxx create mode 100644 inc/bf_xmloff/xmltypes.hxx create mode 100644 inc/bf_xmloff/xmluconv.hxx create mode 100644 inc/legacysmgr/legacy_binfilters_smgr.hxx create mode 100644 legacysmgr/source/legacy/gcc3.map create mode 100644 legacysmgr/source/legacy/legacy_binfilters_smgr.cxx create mode 100644 legacysmgr/source/legacy/makefile.mk create mode 100644 legacysmgr/source/legacy/mingw_intel.map create mode 100644 legacysmgr/source/legacy/msci.map create mode 100644 legacysmgr/source/legacy/sols.map create mode 100644 no_localization create mode 100644 prj/build.lst create mode 100644 prj/d.lst create mode 100644 prj/l10n create mode 100644 qa/cppunit/data/sdw/fail/.gitignore create mode 100644 qa/cppunit/data/sdw/indeterminate/.gitignore create mode 100644 qa/cppunit/data/sdw/pass/.gitignore create mode 100644 qa/cppunit/data/sdw/pass/rsc.sdw create mode 100644 qa/cppunit/data/sdw/pass/rscerror.sdw create mode 100644 qa/cppunit/data/sdw/pass/rscinst.sdw create mode 100644 qa/cppunit/makefile.mk create mode 100644 qa/cppunit/test_binfilter.cxx create mode 100644 util/makefile.mk diff --git a/bf_basic/source/basmgr/basmgr.cxx b/bf_basic/source/basmgr/basmgr.cxx new file mode 100644 index 00000000000..1bdd895225c --- /dev/null +++ b/bf_basic/source/basmgr/basmgr.cxx @@ -0,0 +1,2254 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "basmgr.hxx" +#include "sbintern.hxx" + +#define LIB_SEP 0x01 +#define LIBINFO_SEP 0x02 +#define LIBINFO_ID 0x1491 +#define PASSWORD_MARKER 0x31452134 + + +// Library API, implemented for XML import/export + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace binfilter { + +using namespace com::sun::star::container; +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::script; +using namespace cppu; +using ::std::vector; +using ::std::advance; + +using ::rtl::OUString; + +typedef WeakImplHelper1< XNameContainer > NameContainerHelper; +typedef WeakImplHelper1< XStarBasicModuleInfo > ModuleInfoHelper; +typedef WeakImplHelper1< XStarBasicDialogInfo > DialogInfoHelper; +typedef WeakImplHelper1< XStarBasicLibraryInfo > LibraryInfoHelper; +typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper; + + +#define CURR_VER 2 + +// Version 1 +// ULONG nEndPos +// USHORT nId +// USHORT nVer +// BOOL bDoLoad +// String LibName +// String AbsStorageName +// String RelStorageName +// Version 2 +// + BOOL bReference + +static const char szStdLibName[] = "Standard"; +static const char szBasicStorage[] = "StarBASIC"; +static const char szOldManagerStream[] = "BasicManager"; +static const char szManagerStream[] = "BasicManager2"; +static const char szImbedded[] = "LIBIMBEDDED"; +static const char szCryptingKey[] = "CryptedBasic"; +static const char szScriptLanguage[] = "StarBasic"; + +static const String BasicStreamName( RTL_CONSTASCII_USTRINGPARAM(szBasicStorage) ); +static const String ManagerStreamName( RTL_CONSTASCII_USTRINGPARAM(szManagerStream) ); + +#define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII)) + + +TYPEINIT1( BasicManager, SfxBroadcaster ); +DBG_NAME( BasicManager ); + +StreamMode eStreamReadMode = STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL; +StreamMode eStorageReadMode = STREAM_READ | STREAM_SHARE_DENYWRITE; + +typedef vector< BasicError* > BasErrorLst; + +//---------------------------------------------------------------------------- +// BasicManager impl data +struct BasicManagerImpl +{ + LibraryContainerInfo* mpInfo; + + // Save stream data + SvMemoryStream* mpManagerStream; + SvMemoryStream** mppLibStreams; + sal_Int32 mnLibStreamCount; + sal_Bool mbModifiedByLibraryContainer; + sal_Bool mbError; + + BasicManagerImpl( void ) + : mpInfo( NULL ) + , mpManagerStream( NULL ) + , mppLibStreams( NULL ) + , mnLibStreamCount( 0 ) + , mbModifiedByLibraryContainer( sal_False ) + , mbError( sal_False ) + {} + ~BasicManagerImpl(); +}; + +BasicManagerImpl::~BasicManagerImpl() +{ + delete mpInfo; + delete mpManagerStream; + if( mppLibStreams ) + { + for( sal_Int32 i = 0 ; i < mnLibStreamCount ; i++ ) + delete mppLibStreams[i]; + delete[] mppLibStreams; + } +} + +//============================================================================ +// BasMgrContainerListenerImpl +//============================================================================ + +typedef ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener > ContainerListenerHelper; + +class BasMgrContainerListenerImpl: public ContainerListenerHelper +{ + BasicManager* mpMgr; + OUString maLibName; // empty -> no lib, but lib container + +public: + BasMgrContainerListenerImpl( BasicManager* pMgr, OUString aLibName ) + : mpMgr( pMgr ) + , maLibName( aLibName ) {} + + static void insertLibraryImpl( const Reference< XLibraryContainer >& xScriptCont, BasicManager* pMgr, + Any aLibAny, OUString aLibName ); + static void addLibraryModulesImpl( BasicManager* pMgr, Reference< XNameAccess > xLibNameAccess, + OUString aLibName ); + + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) + throw(::com::sun::star::uno::RuntimeException); + + // XContainerListener + virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) + throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) + throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) + throw(::com::sun::star::uno::RuntimeException); +}; + + +//============================================================================ +// BasMgrContainerListenerImpl +//============================================================================ + +void BasMgrContainerListenerImpl::insertLibraryImpl( const Reference< XLibraryContainer >& xScriptCont, + BasicManager* pMgr, Any aLibAny, OUString aLibName ) +{ + Reference< XNameAccess > xLibNameAccess; + aLibAny >>= xLibNameAccess; + + if( !pMgr->GetLib( aLibName ) ) + { + BasicManager* pBasMgr = static_cast< BasicManager* >( pMgr ); +#ifdef DBG_UTIL + StarBASIC* pLib = +#endif + pBasMgr->CreateLibForLibContainer( aLibName, xScriptCont ); + DBG_ASSERT( pLib, "XML Import: Basic library could not be created"); + } + + Reference< XContainer> xLibContainer( xLibNameAccess, UNO_QUERY ); + if( xLibContainer.is() ) + { + // Register listener for library + Reference< XContainerListener > xLibraryListener + = static_cast< XContainerListener* > + ( new BasMgrContainerListenerImpl( pMgr, aLibName ) ); + xLibContainer->addContainerListener( xLibraryListener ); + } + + if( xScriptCont->isLibraryLoaded( aLibName ) ) + { + addLibraryModulesImpl( pMgr, xLibNameAccess, aLibName ); + } +} + + +void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr, + Reference< XNameAccess > xLibNameAccess, OUString aLibName ) +{ + OUString aScriptLanguage = DEFINE_CONST_UNICODE( szScriptLanguage ); + Sequence< OUString > aModuleNames = xLibNameAccess->getElementNames(); + sal_Int32 nModuleCount = aModuleNames.getLength(); + + StarBASIC* pLib = pMgr->GetLib( aLibName ); + DBG_ASSERT( pLib, "BasMgrContainerListenerImpl::addLibraryModulesImpl: Unknown lib!"); + if( pLib ) + { + const OUString* pNames = aModuleNames.getConstArray(); + for( sal_Int32 j = 0 ; j < nModuleCount ; j++ ) + { + OUString aModuleName = pNames[ j ]; + Any aElement = xLibNameAccess->getByName( aModuleName ); + OUString aMod; + aElement >>= aMod; + pLib->MakeModule32( aModuleName, aMod ); + } + } + + pLib->SetModified( FALSE ); +} + + + +// XEventListener +//---------------------------------------------------------------------------- + +void SAL_CALL BasMgrContainerListenerImpl::disposing( const EventObject& Source ) + throw( RuntimeException ) +{ + (void)Source; +} + +// XContainerListener +//---------------------------------------------------------------------------- + +void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent& Event ) + throw( RuntimeException ) +{ + sal_Bool bLibContainer = ( maLibName.getLength() == 0 ); + OUString aName; + Event.Accessor >>= aName; + + mpMgr->mpImpl->mbModifiedByLibraryContainer = sal_True; + + if( bLibContainer ) + { + Reference< XLibraryContainer > xScriptCont( Event.Source, UNO_QUERY ); + insertLibraryImpl( xScriptCont, mpMgr, Event.Element, aName ); + } + else + { + OUString aScriptLanguage = DEFINE_CONST_UNICODE( szScriptLanguage ); + OUString aMod; + Event.Element >>= aMod; + + StarBASIC* pLib = mpMgr->GetLib( maLibName ); + DBG_ASSERT( pLib, "BasMgrContainerListenerImpl::elementInserted: Unknown lib!"); + if( pLib ) + { + SbModule* pMod = pLib->FindModule( aName ); + if( !pMod ) + { + pLib->MakeModule32( aName, aMod ); + pLib->SetModified( FALSE ); + } + } + } +} + +//---------------------------------------------------------------------------- + +void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const ContainerEvent& Event ) + throw( RuntimeException ) +{ + OUString aName; + Event.Accessor >>= aName; + + mpMgr->mpImpl->mbModifiedByLibraryContainer = sal_True; + + // Replace not possible for library container +#ifdef DBG_UTIL + sal_Bool bLibContainer = ( maLibName.getLength() == 0 ); +#endif + DBG_ASSERT( !bLibContainer, "library container fired elementReplaced()"); + + StarBASIC* pLib = mpMgr->GetLib( maLibName ); + if( pLib ) + { + SbModule* pMod = pLib->FindModule( aName ); + OUString aMod; + Event.Element >>= aMod; + if( pMod ) + pMod->SetSource32( aMod ); + else + pLib->MakeModule32( aName, aMod ); + + pLib->SetModified( FALSE ); + } +} + +//---------------------------------------------------------------------------- + +void SAL_CALL BasMgrContainerListenerImpl::elementRemoved( const ContainerEvent& Event ) + throw( RuntimeException ) +{ + OUString aName; + Event.Accessor >>= aName; + + mpMgr->mpImpl->mbModifiedByLibraryContainer = sal_True; + + sal_Bool bLibContainer = ( maLibName.getLength() == 0 ); + if( bLibContainer ) + { + StarBASIC* pLib = mpMgr->GetLib( aName ); + if( pLib ) + { + USHORT nLibId = mpMgr->GetLibId( aName ); + mpMgr->RemoveLib( nLibId, FALSE ); + } + } + else + { + StarBASIC* pLib = mpMgr->GetLib( maLibName ); + SbModule* pMod = pLib ? pLib->FindModule( aName ) : NULL; + if( pMod ) + { + pLib->Remove( pMod ); + pLib->SetModified( FALSE ); + } + } +} + + +//===================================================================== + +class BasicErrorManager +{ +private: + BasErrorLst aErrorList; + size_t CurrentError; + +public: + BasicErrorManager() { CurrentError = 0; } + ~BasicErrorManager(); + + void Reset(); + void InsertError( const BasicError& rError ); + + BOOL HasErrors() { return !aErrorList.empty(); } +}; + +BasicErrorManager::~BasicErrorManager() +{ + Reset(); +} + +void BasicErrorManager::Reset() +{ + for ( size_t i = 0, n = aErrorList.size(); i < n; ++i ) + delete aErrorList[ i ]; + aErrorList.clear(); +} + +void BasicErrorManager::InsertError( const BasicError& rError ) +{ + aErrorList.push_back( new BasicError( rError ) ); +} + +BasicError::BasicError( ULONG nId, USHORT nR, const String& rErrStr ) : + aErrStr( rErrStr ) +{ + nErrorId = nId; + nReason = nR; +} + +BasicError::BasicError( const BasicError& rErr ) : + aErrStr( rErr.aErrStr ) +{ + nErrorId = rErr.nErrorId; + nReason = rErr.nReason; +} + + +class BasicLibInfo +{ +private: + StarBASICRef xLib; + String aLibName; + String aStorageName; // String reicht, da zur Laufzeit eindeutig. + String aRelStorageName; + String aPassword; + + BOOL bDoLoad; + BOOL bReference; + BOOL bPasswordVerified; + BOOL bFoundInPath; // Darf dann nicht neu relativiert werden! + + // Lib represents library in new UNO library container + Reference< XLibraryContainer > mxScriptCont; + +public: + BasicLibInfo(); + + BOOL IsReference() const { return bReference; } + BOOL& IsReference() { return bReference; } + + BOOL IsExtern() const { return ! aStorageName.EqualsAscii(szImbedded); } + + void SetStorageName( const String& rName ) { aStorageName = rName; } + const String& GetStorageName() const { return aStorageName; } + + void SetRelStorageName( const String& rN ) { aRelStorageName = rN; } + const String& GetRelStorageName() const { return aRelStorageName; } + + StarBASICRef GetLib() const + { + if( mxScriptCont.is() && mxScriptCont->hasByName( aLibName ) && + !mxScriptCont->isLibraryLoaded( aLibName ) ) + return StarBASICRef(); + return xLib; + } + StarBASICRef& GetLibRef() { return xLib; } + void SetLib( StarBASIC* pBasic ) { xLib = pBasic; } + + const String& GetLibName() const { return aLibName; } + void SetLibName( const String& rName ) { aLibName = rName; } + + // Only temporary, for saving/loading ... + BOOL DoLoad() { return bDoLoad; } + + BOOL HasPassword() const { return aPassword.Len() != 0; } + const String& GetPassword() const { return aPassword; } + void SetPassword( const String& rNewPassword ) + { aPassword = rNewPassword; } + BOOL IsPasswordVerified() const { return bPasswordVerified; } + void SetPasswordVerified() { bPasswordVerified = TRUE; } + + BOOL IsFoundInPath() const { return bFoundInPath; } + void SetFoundInPath( BOOL bInPath ) { bFoundInPath = bInPath; } + + void Store( SotStorageStream&, const String&, BOOL ) {} + static BasicLibInfo* Create( SotStorageStream& rSStream ); + + Reference< XLibraryContainer > GetLibraryContainer( void ) + { return mxScriptCont; } + void SetLibraryContainer( const Reference< XLibraryContainer >& xScriptCont ) + { mxScriptCont = xScriptCont; } +}; + +typedef vector< BasicLibInfo* > BasicLibsBase; + +class BasicLibs +{ +private: + BasicLibsBase mpList; + size_t current; + +public: + String aBasicLibPath; // soll eigentlich Member vom Manager werden, aber jetzt nicht inkompatibel! + BasicLibInfo* GetObject( size_t i ); + void Insert( BasicLibInfo* item, size_t i ); + void Clear() { mpList.clear(); } + size_t Count() { return mpList.size(); } + size_t GetPos( BasicLibInfo* pItem ); + size_t GetCurPos() { return current; } + BasicLibInfo* First(); + BasicLibInfo* Next(); + BasicLibInfo* Prev(); + BasicLibInfo* Last(); + BasicLibInfo* Remove( BasicLibInfo* pItem ); +}; + +size_t BasicLibs::GetPos( BasicLibInfo* pItem ) +{ + for ( size_t i = 0, n = mpList.size(); i < n; ++i ) + if ( mpList[ i ] == pItem ) + return i; + return size_t(-1); +} + +void BasicLibs::Insert( BasicLibInfo* pItem, size_t i ) +{ + if ( i >= mpList.size() ) + { + mpList.push_back( pItem ); + current = mpList.size() - 1; + } + else + { + BasicLibsBase::iterator it = mpList.begin(); + advance( it, i ); + mpList.insert( it, pItem ); + current = i; + } +} + +BasicLibInfo* BasicLibs::Remove( BasicLibInfo* pItem ) +{ + size_t pos = GetPos( pItem ); + if ( pos == size_t(-1) ) return NULL; + + current = pos; + BasicLibsBase::iterator it = mpList.begin(); + advance( it, pos ); + mpList.erase( it ); + return pItem; +} + +BasicLibInfo* BasicLibs::GetObject( size_t i ) +{ + if ( i >= mpList.size() ) return NULL; + return mpList[ i ]; +} + +BasicLibInfo* BasicLibs::First() +{ + current = 0; + if ( mpList.empty() ) return NULL; + return mpList[ current ]; +} + +BasicLibInfo* BasicLibs::Next() +{ + if ( mpList.empty() + || current+1 >= mpList.size() + ) + return NULL; + current++; + return mpList[ current ]; +} + +BasicLibInfo* BasicLibs::Prev() +{ + if ( mpList.empty() + || current == 0 + ) + return NULL; + current--; + return mpList[ current ]; +} + +BasicLibInfo* BasicLibs::Last() +{ + if ( mpList.empty() ) return NULL; + current = mpList.size() - 1; + return mpList[ current ]; +} + +BasicLibInfo::BasicLibInfo() +{ + bReference = FALSE; + bPasswordVerified = FALSE; + bDoLoad = FALSE; + bFoundInPath = FALSE; + mxScriptCont = NULL; + aStorageName = String::CreateFromAscii(szImbedded); + aRelStorageName = String::CreateFromAscii(szImbedded); +} + +BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream ) +{ + BasicLibInfo* pInfo = new BasicLibInfo; + + sal_uInt32 nEndPos; + USHORT nId; + USHORT nVer; + + rSStream >> nEndPos; + rSStream >> nId; + rSStream >> nVer; + + DBG_ASSERT( nId == LIBINFO_ID, "Without BasicLibInfo !?" ); + if( nId == LIBINFO_ID ) + { + // Load again? + BOOL bDoLoad; + rSStream >> bDoLoad; + pInfo->bDoLoad = bDoLoad; + + // Den Namen der Lib... + String aName; + rSStream.ReadByteString(aName); + pInfo->SetLibName( aName ); + + // Absoluter Pfad.... + String aStorageName; + rSStream.ReadByteString(aStorageName); + pInfo->SetStorageName( aStorageName ); + + // Relativer Pfad... + String aRelStorageName; + rSStream.ReadByteString(aRelStorageName); + pInfo->SetRelStorageName( aRelStorageName ); + + if ( nVer >= 2 ) + { + BOOL bReferenz; + rSStream >> bReferenz; + pInfo->IsReference() = bReferenz; + } + + rSStream.Seek( nEndPos ); + } + return pInfo; +} + +BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib, String* pLibPath ) +{ + DBG_CTOR( BasicManager, 0 ); + + Init(); + + if( pLibPath ) + pLibs->aBasicLibPath = *pLibPath; + + String aStorName( rStorage.GetName() ); + maStorageName = INetURLObject(aStorName, INET_PROT_FILE).GetMainURL( INetURLObject::NO_DECODE ); + + // #91251: Storage name not longer available for documents < 5.0 + // Should be no real problem, because only relative storage names + // (links) can be affected. + + // Wenn es den Manager-Stream nicht gibt, sind keine weiteren + // Aktionen noetig. + if ( rStorage.IsStream( ManagerStreamName ) ) + { + LoadBasicManager( rStorage, rBaseURL ); + // StdLib erhaelt gewuenschten Parent: + StarBASIC* pStdLib = GetStdLib(); + DBG_ASSERT( pStdLib, "Standard-Lib nicht geladen?" ); + if ( !pStdLib ) + { + // Sollte eigentlich nie passieren, aber dann wenigstens nicht abstuerzen... + pStdLib = new StarBASIC; + BasicLibInfo* pStdLibInfo = pLibs->GetObject( 0 ); + if ( !pStdLibInfo ) + pStdLibInfo = CreateLibInfo(); + pStdLibInfo->SetLib( pStdLib ); + StarBASICRef xStdLib = pStdLibInfo->GetLib(); + xStdLib->SetName( String::CreateFromAscii(szStdLibName) ); + pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + xStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); + xStdLib->SetModified( FALSE ); + } + else + { + pStdLib->SetParent( pParentFromStdLib ); + // Die anderen erhalten die StdLib als Parent: + for ( USHORT nBasic = 1; nBasic < GetLibCount(); nBasic++ ) + { + StarBASIC* pBasic = GetLib( nBasic ); + if ( pBasic ) + { + pStdLib->Insert( pBasic ); + pBasic->SetFlag( SBX_EXTSEARCH ); + } + } + // Durch das Insert modified: + pStdLib->SetModified( FALSE ); + } + + // #91626 Save all stream data to save it unmodified if basic isn't modified + // in an 6.0+ office. So also the old basic dialogs can be saved. + SotStorageStreamRef xManagerStream = rStorage.OpenSotStream + ( ManagerStreamName, eStreamReadMode ); + mpImpl->mpManagerStream = new SvMemoryStream(); + *static_cast(&xManagerStream) >> *mpImpl->mpManagerStream; + + SotStorageRef xBasicStorage = rStorage.OpenSotStorage + ( BasicStreamName, eStorageReadMode, FALSE ); + if( xBasicStorage.Is() && !xBasicStorage->GetError() ) + { + USHORT nLibs = GetLibCount(); + mpImpl->mppLibStreams = new SvMemoryStream*[ nLibs ]; + for( USHORT nL = 0; nL < nLibs; nL++ ) + { + BasicLibInfo* pInfo = pLibs->GetObject( nL ); + DBG_ASSERT( pInfo, "pInfo?!" ); + SotStorageStreamRef xBasicStream = xBasicStorage->OpenSotStream( pInfo->GetLibName(), eStreamReadMode ); + mpImpl->mppLibStreams[nL] = new SvMemoryStream(); + *static_cast(&xBasicStream) >> *( mpImpl->mppLibStreams[nL] ); + } + } + else + mpImpl->mbError = sal_True; + } + else + { + ImpCreateStdLib( pParentFromStdLib ); + if ( rStorage.IsStream( String::CreateFromAscii(szOldManagerStream) ) ) + LoadOldBasicManager( rStorage ); + } + + bBasMgrModified = FALSE; +} + + +void copyToLibraryContainer( StarBASIC* pBasic, LibraryContainerInfo* pInfo ) +{ + Reference< XLibraryContainer > xScriptCont; + String aLibName = pBasic->GetName(); + if( pInfo && (xScriptCont = pInfo->mxScriptCont).is() ) + { + if( !xScriptCont->hasByName( aLibName ) ) + xScriptCont->createLibrary( aLibName ); + + Any aLibAny = xScriptCont->getByName( aLibName ); + Reference< XNameContainer > xLib; + aLibAny >>= xLib; + if( xLib.is() ) + { + USHORT nModCount = pBasic->GetModules()->Count(); + for ( USHORT nMod = 0 ; nMod < nModCount ; nMod++ ) + { + SbModule* pModule = (SbModule*)pBasic->GetModules()->Get( nMod ); + DBG_ASSERT( pModule, "Modul nicht erhalten!" ); + + String aModName = pModule->GetName(); + if( !xLib->hasByName( aModName ) ) + { + OUString aSource = pModule->GetSource32(); + Any aSourceAny; + aSourceAny <<= aSource; + xLib->insertByName( aModName, aSourceAny ); + } + } + } + } +} + +void BasicManager::SetLibraryContainerInfo( LibraryContainerInfo* pInfo ) +{ + if( !pInfo ) + return; + mpImpl->mpInfo = pInfo; + + Reference< XLibraryContainer > xScriptCont; + StarBASIC* pStdLib = GetStdLib(); + String aLibName = pStdLib->GetName(); + if( mpImpl->mpInfo && (xScriptCont = mpImpl->mpInfo->mxScriptCont).is() ) + { + OUString aScriptLanguage = DEFINE_CONST_UNICODE( "StarBasic" ); + + // Register listener for lib container + OUString aEmptyLibName; + Reference< XContainerListener > xLibContainerListener + = static_cast< XContainerListener* > + ( new BasMgrContainerListenerImpl( this, aEmptyLibName ) ); + + Reference< XContainer> xLibContainer( xScriptCont, UNO_QUERY ); + xLibContainer->addContainerListener( xLibContainerListener ); + + Sequence< OUString > aNames = xScriptCont->getElementNames(); + const OUString* pNames = aNames.getConstArray(); + sal_Int32 i, nNameCount = aNames.getLength(); + + if( nNameCount ) + { + for( i = 0 ; i < nNameCount ; i++ ) + { + OUString aLibName2 = pNames[ i ]; + Any aLibAny = xScriptCont->getByName( aLibName2 ); + + if( String( aLibName2 ).EqualsAscii( "Standard" ) ) + xScriptCont->loadLibrary( aLibName2 ); + + BasMgrContainerListenerImpl::insertLibraryImpl + ( xScriptCont, this, aLibAny, aLibName2 ); + } + } + else + { + // No libs? Maybe an 5.2 document already loaded + USHORT nLibs = GetLibCount(); + for( USHORT nL = 0; nL < nLibs; nL++ ) + { + BasicLibInfo* pBasLibInfo = pLibs->GetObject( nL ); + StarBASIC* pLib = pBasLibInfo->GetLib(); + if( !pLib ) + { + BOOL bLoaded = ImpLoadLibary( pBasLibInfo, NULL, FALSE ); + if( bLoaded ) + pLib = pBasLibInfo->GetLib(); + } + if( pLib ) + { + copyToLibraryContainer( pLib, mpImpl->mpInfo ); + if( pBasLibInfo->HasPassword() ) + { + OldBasicPassword* pOldBasicPassword = + mpImpl->mpInfo->mpOldBasicPassword; + if( pOldBasicPassword ) + { + pOldBasicPassword->setLibraryPassword + ( pLib->GetName(), pBasLibInfo->GetPassword() ); + pBasLibInfo->SetPasswordVerified(); + } + } + } + } + + mpImpl->mbModifiedByLibraryContainer = sal_False; + } + } +} + +BasicManager::BasicManager( StarBASIC* pSLib, String* pLibPath ) +{ + DBG_CTOR( BasicManager, 0 ); + Init(); + DBG_ASSERT( pSLib, "BasicManager kann nicht mit einem NULL-Pointer erzeugt werden!" ); + + if( pLibPath ) + pLibs->aBasicLibPath = *pLibPath; + + BasicLibInfo* pStdLibInfo = CreateLibInfo(); + pStdLibInfo->SetLib( pSLib ); + StarBASICRef xStdLib = pStdLibInfo->GetLib(); + xStdLib->SetName( String::CreateFromAscii(szStdLibName)); + pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + pSLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); + + // Speichern lohnt sich nur, wenn sich das Basic aendert. + xStdLib->SetModified( FALSE ); + bBasMgrModified = FALSE; +} + +BOOL BasicManager::HasBasicWithModules( const SotStorage& rStorage, const String& rBaseURL ) +{ + if( !rStorage.IsStream( ManagerStreamName ) ) + return FALSE; + + StarBASIC* pDummyParentBasic = new StarBASIC(); + BasicManager* pBasMgr = new BasicManager( (SotStorage&)rStorage, rBaseURL, pDummyParentBasic ); + BOOL bRet = FALSE; + + USHORT nLibs = pBasMgr->GetLibCount(); + for( USHORT nL = 0; nL < nLibs; nL++ ) + { + BasicLibInfo* pInfo = pBasMgr->pLibs->GetObject( nL ); + StarBASIC* pLib = pInfo->GetLib(); + if( !pLib ) + { + BOOL bLoaded = pBasMgr->ImpLoadLibary( pInfo, NULL, FALSE ); + if( bLoaded ) + pLib = pInfo->GetLib(); + } + if( pLib ) + { + SbxArray* pModules = pLib->GetModules(); + if( pModules->Count() ) + { + bRet = TRUE; + break; + } + } + } + + delete pBasMgr; + return bRet; +} + +void BasicManager::ImpMgrNotLoaded( const String& rStorageName ) +{ + // pErrInf wird nur zerstoert, wenn der Fehler von einem ErrorHandler + // gehandelt wird! + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_OPENMGRSTREAM, rStorageName ) ); + + // Eine STD-Lib erzeugen, sonst macht es Peng! + BasicLibInfo* pStdLibInfo = CreateLibInfo(); + pStdLibInfo->SetLib( new StarBASIC ); + StarBASICRef xStdLib = pStdLibInfo->GetLib(); + xStdLib->SetName( String::CreateFromAscii(szStdLibName) ); + pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + xStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); + xStdLib->SetModified( FALSE ); +} + + +void BasicManager::ImpCreateStdLib( StarBASIC* pParentFromStdLib ) +{ + BasicLibInfo* pStdLibInfo = CreateLibInfo(); + StarBASIC* pStdLib = new StarBASIC( pParentFromStdLib ); + pStdLibInfo->SetLib( pStdLib ); + pStdLib->SetName( String::CreateFromAscii(szStdLibName) ); + pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + pStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); +} + + +void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseURL, BOOL bLoadLibs ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + + + SotStorageStreamRef xManagerStream = rStorage.OpenSotStream + ( ManagerStreamName, eStreamReadMode ); + + String aStorName( rStorage.GetName() ); + // #i13114 removed, DBG_ASSERT( aStorName.Len(), "No Storage Name!" ); + + if ( !xManagerStream.Is() || xManagerStream->GetError() || ( xManagerStream->Seek( STREAM_SEEK_TO_END ) == 0 ) ) + { + ImpMgrNotLoaded( aStorName ); + return; + } + + maStorageName = INetURLObject(aStorName, INET_PROT_FILE).GetMainURL( INetURLObject::NO_DECODE ); + // #i13114 removed, DBG_ASSERT(aStorageName.Len() != 0, "Bad storage name"); + + String aRealStorageName = maStorageName; // fuer relative Pfade, kann durch BaseURL umgebogen werden. + + // Wenn aus Vorlagen geladen wird, gilt nur die BaseURL: + if ( rBaseURL.Len() ) + { + INetURLObject aObj( rBaseURL ); + if ( aObj.GetProtocol() == INET_PROT_FILE ) + aRealStorageName = aObj.PathToFileName(); + } + + xManagerStream->SetBufferSize( 1024 ); + xManagerStream->Seek( STREAM_SEEK_TO_BEGIN ); + + sal_uInt32 nEndPos; + *xManagerStream >> nEndPos; + + USHORT nLibs; + *xManagerStream >> nLibs; + // Plausi! + if( nLibs & 0xF000 ) + { + DBG_ASSERT( !this, "BasicManager-Stream defekt!" ); + return; + } + for ( USHORT nL = 0; nL < nLibs; nL++ ) + { + BasicLibInfo* pInfo = BasicLibInfo::Create( *xManagerStream ); + + // ggf. absoluten Pfad-Namen korrigieren, wenn rel. existiert + // Immer erst den relativen versuchen, falls zwei Staende auf der Platte + if ( pInfo->GetRelStorageName().Len() && ( ! pInfo->GetRelStorageName().EqualsAscii(szImbedded) ) ) + { + INetURLObject aObj( aRealStorageName, INET_PROT_FILE ); + aObj.removeSegment(); + bool bWasAbsolute = FALSE; + aObj = aObj.smartRel2Abs( pInfo->GetRelStorageName(), bWasAbsolute ); + + if ( pLibs->aBasicLibPath.Len() ) + { + // Lib im Pfad suchen... + String aSearchFile = pInfo->GetRelStorageName(); + SvtPathOptions aPathCFG; + if( aPathCFG.SearchFile( aSearchFile, SvtPathOptions::PATH_BASIC ) ) + { + pInfo->SetStorageName( aSearchFile ); + pInfo->SetFoundInPath( TRUE ); + } + } + } + + pLibs->Insert( pInfo, LIST_APPEND ); + // Libs aus externen Dateien sollen erst bei Bedarf geladen werden. + // Aber Referenzen werden gleich geladen, sonst bekommen die Grosskunden + // vielleicht Probleme... + if ( bLoadLibs && pInfo->DoLoad() && + ( ( !pInfo->IsExtern() ) || ( pInfo->IsReference() ) ) ) + { + ImpLoadLibary( pInfo, &rStorage ); + } + } + + xManagerStream->Seek( nEndPos ); + xManagerStream->SetBufferSize( 0 ); + xManagerStream.Clear(); +} + +void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + + + SotStorageStreamRef xManagerStream = rStorage.OpenSotStream + ( String::CreateFromAscii(szOldManagerStream), eStreamReadMode ); + + String aStorName( rStorage.GetName() ); + DBG_ASSERT( aStorName.Len(), "No Storage Name!" ); + + if ( !xManagerStream.Is() || xManagerStream->GetError() || ( xManagerStream->Seek( STREAM_SEEK_TO_END ) == 0 ) ) + { + ImpMgrNotLoaded( aStorName ); + return; + } + + xManagerStream->SetBufferSize( 1024 ); + xManagerStream->Seek( STREAM_SEEK_TO_BEGIN ); + sal_uInt32 nBasicStartOff, nBasicEndOff; + *xManagerStream >> nBasicStartOff; + *xManagerStream >> nBasicEndOff; + + DBG_ASSERT( !xManagerStream->GetError(), "Ungueltiger Manager-Stream!" ); + + xManagerStream->Seek( nBasicStartOff ); + if( !ImplLoadBasic( *xManagerStream, pLibs->GetObject(0)->GetLibRef() ) ) + { + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_OPENMGRSTREAM, aStorName ) ); + // und es geht weiter... + } + xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 als Trenner + String aLibs; + xManagerStream->ReadByteString(aLibs); + xManagerStream->SetBufferSize( 0 ); + xManagerStream.Clear(); // Sream schliessen + + if ( aLibs.Len() ) + { + String aCurStorageName( aStorName ); + INetURLObject aCurStorage( aCurStorageName, INET_PROT_FILE ); + USHORT nLibs = aLibs.GetTokenCount( LIB_SEP ); + for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + { + String aLibInfo( aLibs.GetToken( nLib, LIB_SEP ) ); + // == 2 soll irgendwann weg! + DBG_ASSERT( ( aLibInfo.GetTokenCount( LIBINFO_SEP ) == 2 ) || ( aLibInfo.GetTokenCount( LIBINFO_SEP ) == 3 ), "Ungueltige Lib-Info!" ); + String aLibName( aLibInfo.GetToken( 0, LIBINFO_SEP ) ); + String aLibAbsStorageName( aLibInfo.GetToken( 1, LIBINFO_SEP ) ); + String aLibRelStorageName( aLibInfo.GetToken( 2, LIBINFO_SEP ) ); + INetURLObject aLibAbsStorage( aLibAbsStorageName, INET_PROT_FILE ); + + INetURLObject aLibRelStorage( aStorName ); + aLibRelStorage.removeSegment(); + bool bWasAbsolute = FALSE; + aLibRelStorage = aLibRelStorage.smartRel2Abs( aLibRelStorageName, bWasAbsolute); + DBG_ASSERT(!bWasAbsolute, "RelStorageName was absolute!" ); + + SotStorageRef xStorageRef; + if ( ( aLibAbsStorage == aCurStorage ) || ( aLibRelStorageName.EqualsAscii(szImbedded) ) ) + xStorageRef = &rStorage; + else + { + xStorageRef = new SotStorage( FALSE, aLibAbsStorage.GetMainURL + ( INetURLObject::NO_DECODE ), eStorageReadMode, TRUE ); + if ( xStorageRef->GetError() != ERRCODE_NONE ) + xStorageRef = new SotStorage( FALSE, aLibRelStorage. + GetMainURL( INetURLObject::NO_DECODE ), eStorageReadMode, TRUE ); + } + if ( xStorageRef.Is() ) + AddLib( *xStorageRef, aLibName, FALSE ); + else + { + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_STORAGENOTFOUND, aStorName ) ); + } + } + } +} + +BasicManager::~BasicManager() +{ + DBG_DTOR( BasicManager, 0 ); + + // Listener benachrichtigen, falls noch etwas zu Speichern... + Broadcast( SfxSimpleHint( SFX_HINT_DYING) ); + + // Basic-Infos zerstoeren... + // In umgekehrter Reihenfolge, weil die StdLib Referenzen haelt, die + // anderen nur die StdLib als Parent haben. + BasicLibInfo* pInf = pLibs->Last(); + while ( pInf ) + { + delete pInf; + pInf = pLibs->Prev(); + } + pLibs->Clear(); + delete pLibs; + delete pErrorMgr; + delete mpImpl; +} + +void BasicManager::LegacyDeleteBasicManager( BasicManager*& _rpManager ) +{ + delete _rpManager; + _rpManager = NULL; +} + +void BasicManager::Init() +{ + DBG_CHKTHIS( BasicManager, 0 ); + + bBasMgrModified = FALSE; + pErrorMgr = new BasicErrorManager; + pLibs = new BasicLibs; + mpImpl = new BasicManagerImpl(); +} + +BasicLibInfo* BasicManager::CreateLibInfo() +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pInf = new BasicLibInfo; + pLibs->Insert( pInf, LIST_APPEND ); + return pInf; +} + +BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, BOOL bInfosOnly ) const +{ + DBG_CHKTHIS( BasicManager, 0 ); + + DBG_ASSERT( pLibInfo, "LibInfo!?" ); + + String aStorageName( pLibInfo->GetStorageName() ); + if ( !aStorageName.Len() || ( aStorageName.EqualsAscii(szImbedded) ) ) + aStorageName = GetStorageName(); + + SotStorageRef xStorage; + // Der aktuelle darf nicht nochmal geoffnet werden... + if ( pCurStorage ) + { + String aStorName( pCurStorage->GetName() ); + // #i13114 removed, DBG_ASSERT( aStorName.Len(), "No Storage Name!" ); + + INetURLObject aCurStorageEntry(aStorName, INET_PROT_FILE); + // #i13114 removed, DBG_ASSERT(aCurStorageEntry.GetMainURL( INetURLObject::NO_DECODE ).Len() != 0, "Bad storage name"); + + INetURLObject aStorageEntry(aStorageName, INET_PROT_FILE); + // #i13114 removed, DBG_ASSERT(aCurStorageEntry.GetMainURL( INetURLObject::NO_DECODE ).Len() != 0, "Bad storage name"); + + if ( aCurStorageEntry == aStorageEntry ) + xStorage = pCurStorage; + } + + if ( !xStorage.Is() ) + xStorage = new SotStorage( FALSE, aStorageName, eStorageReadMode ); + + SotStorageRef xBasicStorage = xStorage->OpenSotStorage + ( BasicStreamName, eStorageReadMode, FALSE ); + + if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) + { + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_OPENLIBSTORAGE, pLibInfo->GetLibName() ) ); + } + else + { + // In dem Basic-Storage liegt jede Lib in einem Stream... + SotStorageStreamRef xBasicStream = xBasicStorage->OpenSotStream( pLibInfo->GetLibName(), eStreamReadMode ); + if ( !xBasicStream.Is() || xBasicStream->GetError() ) + { + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_OPENLIBSTREAM, pLibInfo->GetLibName() ) ); + } + else + { + BOOL bLoaded = FALSE; + if ( xBasicStream->Seek( STREAM_SEEK_TO_END ) != 0 ) + { + if ( !bInfosOnly ) + { + if ( !pLibInfo->GetLib().Is() ) + pLibInfo->SetLib( new StarBASIC( GetStdLib() ) ); + xBasicStream->SetBufferSize( 1024 ); + xBasicStream->Seek( STREAM_SEEK_TO_BEGIN ); + bLoaded = ImplLoadBasic( *xBasicStream, pLibInfo->GetLibRef() ); + xBasicStream->SetBufferSize( 0 ); + StarBASICRef xStdLib = pLibInfo->GetLib(); + xStdLib->SetName( pLibInfo->GetLibName() ); + xStdLib->SetModified( FALSE ); + xStdLib->SetFlag( SBX_DONTSTORE ); + } + else + { + // Das Basic skippen... + xBasicStream->Seek( STREAM_SEEK_TO_BEGIN ); + ImplEncryptStream( *xBasicStream ); + SbxBase::Skip( *xBasicStream ); + bLoaded = TRUE; + } + } + if ( !bLoaded ) + { + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_BASICLOADERROR, pLibInfo->GetLibName() ) ); + } + else + { + // Ggf. stehen weitere Informationen im Stream... + xBasicStream->SetCryptMaskKey(szCryptingKey); + xBasicStream->RefreshBuffer(); + sal_uInt32 nPasswordMarker = 0; + *xBasicStream >> nPasswordMarker; + if ( ( nPasswordMarker == PASSWORD_MARKER ) && !xBasicStream->IsEof() ) + { + String aPassword; + xBasicStream->ReadByteString(aPassword); + pLibInfo->SetPassword( aPassword ); + } + xBasicStream->SetCryptMaskKey(rtl::OString()); + CheckModules( pLibInfo->GetLib(), pLibInfo->IsReference() ); + } + return bLoaded; + } + } + return FALSE; +} + +BOOL BasicManager::ImplEncryptStream( SvStream& rStrm ) const +{ + ULONG nPos = rStrm.Tell(); + UINT32 nCreator; + rStrm >> nCreator; + rStrm.Seek( nPos ); + BOOL bProtected = FALSE; + if ( nCreator != SBXCR_SBX ) + { + // sollte nur bei verschluesselten Streams nicht stimmen. + bProtected = TRUE; + rStrm.SetCryptMaskKey(szCryptingKey); + rStrm.RefreshBuffer(); + } + return bProtected; +} + + +// Dieser Code ist notwendig, um das BASIC der Beta 1 laden zu koennen +BOOL BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const +{ + BOOL bProtected = ImplEncryptStream( rStrm ); + SbxBaseRef xNew = SbxBase::Load( rStrm ); + BOOL bLoaded = FALSE; + if( xNew.Is() ) + { + if( xNew->IsA( TYPE(StarBASIC) ) ) + { + StarBASIC* pNew = (StarBASIC*)(SbxBase*) xNew; + // Den Parent des alten BASICs uebernehmen + if( rOldBasic.Is() ) + { + pNew->SetParent( rOldBasic->GetParent() ); + if( pNew->GetParent() ) + pNew->GetParent()->Insert( pNew ); + pNew->SetFlag( SBX_EXTSEARCH ); + } + rOldBasic = pNew; + + // Fill new libray container (5.2 -> 6.0) + copyToLibraryContainer( pNew, mpImpl->mpInfo ); + + pNew->SetModified( FALSE ); + bLoaded = TRUE; + } + } + if ( bProtected ) + rStrm.SetCryptMaskKey(rtl::OString()); + return bLoaded; +} + +void BasicManager::CheckModules( StarBASIC* pLib, BOOL bReference ) const +{ + if ( !pLib ) + return; + + BOOL bModified = pLib->IsModified(); + + // #67477, AB 8.12.99 On demand Compilieren bei referenzierten + // Libraries sollte nicht zu modified fuehren + if( !bModified && bReference ) + { + OSL_FAIL( "Per Reference eingebundene Basic-Library ist nicht compiliert!" ); + pLib->SetModified( FALSE ); + } +} + + +StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const String& rLibName, BOOL bReference ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + + String aStorName( rStorage.GetName() ); + DBG_ASSERT( aStorName.Len(), "No Storage Name!" ); + + String aStorageName = INetURLObject(aStorName, INET_PROT_FILE).GetMainURL( INetURLObject::NO_DECODE ); + DBG_ASSERT(aStorageName.Len() != 0, "Bad storage name"); + + String aNewLibName( rLibName ); + while ( HasLib( aNewLibName ) ) + aNewLibName += '_'; + + BasicLibInfo* pLibInfo = CreateLibInfo(); + // Erstmal mit dem Original-Namen, da sonst ImpLoadLibary nicht geht... + pLibInfo->SetLibName( rLibName ); + // Funktioniert so aber nicht, wenn Name doppelt + USHORT nLibId = (USHORT) pLibs->GetPos( pLibInfo ); + + // Vorm Laden StorageNamen setzen, da er mit pCurStorage verglichen wird. + pLibInfo->SetStorageName( aStorageName ); + BOOL bLoaded = ImpLoadLibary( pLibInfo, &rStorage ); + + if ( bLoaded ) + { + if ( aNewLibName != rLibName ) + SetLibName( nLibId, aNewLibName ); + + if ( bReference ) + { + pLibInfo->GetLib()->SetModified( FALSE ); // Dann nicht speichern + pLibInfo->SetRelStorageName( String() ); + pLibInfo->IsReference() = TRUE; + } + else + { + pLibInfo->GetLib()->SetModified( TRUE ); // Muss nach Add gespeichert werden! + pLibInfo->SetStorageName( String::CreateFromAscii(szImbedded) ); // Im BasicManager-Storage speichern + } + bBasMgrModified = TRUE; + } + else + { + RemoveLib( nLibId, FALSE ); + pLibInfo = 0; + } + + if( pLibInfo ) + return &*pLibInfo->GetLib() ; + else + return 0; +} +BOOL BasicManager::IsReference( USHORT nLib ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pLibInfo = pLibs->GetObject( nLib ); + DBG_ASSERT( pLibInfo, "Lib?!" ); + if ( pLibInfo ) + return pLibInfo->IsReference(); + + return FALSE; +} + +BOOL BasicManager::RemoveLib( USHORT nLib ) +{ + // Nur physikalisch loeschen, wenn keine Referenz. + return RemoveLib( nLib, !IsReference( nLib ) ); +} + +BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + DBG_ASSERT( nLib, "Standard-Lib kann nicht entfernt werden!" ); + + BasicLibInfo* pLibInfo = pLibs->GetObject( nLib ); + DBG_ASSERT( pLibInfo, "Lib nicht gefunden!" ); + + if ( !pLibInfo || !nLib ) + { +// String aErrorText( BasicResId( IDS_SBERR_REMOVELIB ) ); + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, String(), ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_STDLIB, pLibInfo->GetLibName() ) ); + return FALSE; + } + + // Wenn einer der Streams nicht geoeffnet werden kann, ist es kein + // Fehler, es gibt halt noch nichts zum loeschen, weil das Basic noch + // nie geschrieben wurde... + if ( bDelBasicFromStorage && !pLibInfo->IsReference() && + ( !pLibInfo->IsExtern() || SotStorage::IsStorageFile( pLibInfo->GetStorageName() ) ) ) + { + SotStorageRef xStorage; + if ( !pLibInfo->IsExtern() ) + xStorage = new SotStorage( FALSE, GetStorageName() ); + else + xStorage = new SotStorage( FALSE, pLibInfo->GetStorageName() ); + + if ( xStorage->IsStorage( BasicStreamName ) ) + { + SotStorageRef xBasicStorage = xStorage->OpenSotStorage + ( BasicStreamName, STREAM_STD_READWRITE, FALSE ); + + if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) + { + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, String(), ERRCODE_BUTTON_OK ); + pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_OPENLIBSTORAGE, pLibInfo->GetLibName() ) ); + } + else if ( xBasicStorage->IsStream( pLibInfo->GetLibName() ) ) + { + xBasicStorage->Remove( pLibInfo->GetLibName() ); + xBasicStorage->Commit(); + + // Wenn kein weiterer Stream vorhanden, + // dann auch den SubStorage loeschen. + SvStorageInfoList aInfoList; + xBasicStorage->FillInfoList( &aInfoList ); + if ( aInfoList.empty() ) + { + xBasicStorage.Clear(); + xStorage->Remove( BasicStreamName ); + xStorage->Commit(); + // Wenn kein weiterer Streams oder SubStorages vorhanden, + // dann auch den Storage loeschen. + aInfoList.clear(); + xStorage->FillInfoList( &aInfoList ); + if ( aInfoList.empty() ) + { + String aName_( xStorage->GetName() ); + xStorage.Clear(); + } + } + } + } + } + bBasMgrModified = TRUE; + if ( pLibInfo->GetLib().Is() ) + GetStdLib()->Remove( pLibInfo->GetLib() ); + delete pLibs->Remove( pLibInfo ); + return TRUE; // Remove hat geklappt, Del unwichtig. +} + +USHORT BasicManager::GetLibCount() const +{ + DBG_CHKTHIS( BasicManager, 0 ); + return (USHORT)pLibs->Count(); +} + +StarBASIC* BasicManager::GetLib( USHORT nLib ) const +{ + DBG_CHKTHIS( BasicManager, 0 ); + BasicLibInfo* pInf = pLibs->GetObject( nLib ); + DBG_ASSERT( pInf, "Lib existiert nicht!" ); + if ( pInf ) + return pInf->GetLib(); + return 0; +} + +StarBASIC* BasicManager::GetStdLib() const +{ + DBG_CHKTHIS( BasicManager, 0 ); + StarBASIC* pLib = GetLib( 0 ); + return pLib; +} + +StarBASIC* BasicManager::GetLib( const String& rName ) const +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pInf = pLibs->First(); + while ( pInf ) + { + if ( pInf->GetLibName().CompareIgnoreCaseToAscii( rName ) == COMPARE_EQUAL ) // prueffen, ob vorhanden... + return pInf->GetLib(); + + pInf = pLibs->Next(); + } + return 0; +} + +USHORT BasicManager::GetLibId( const String& rName ) const +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pInf = pLibs->First(); + while ( pInf ) + { + if ( pInf->GetLibName().CompareIgnoreCaseToAscii( rName ) == COMPARE_EQUAL ) + return (USHORT)pLibs->GetCurPos(); + + pInf = pLibs->Next(); + } + return LIB_NOTFOUND; +} + +BOOL BasicManager::HasLib( const String& rName ) const +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pInf = pLibs->First(); + while ( pInf ) + { + if ( pInf->GetLibName().CompareIgnoreCaseToAscii( rName ) == COMPARE_EQUAL ) + return TRUE; + + pInf = pLibs->Next(); + } + return FALSE; +} + +BOOL BasicManager::SetLibName( USHORT nLib, const String& rName ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pLibInfo = pLibs->GetObject( nLib ); + DBG_ASSERT( pLibInfo, "Lib?!" ); + if ( pLibInfo ) + { + pLibInfo->SetLibName( rName ); + if ( pLibInfo->GetLib().Is() ) + { + StarBASICRef xStdLib = pLibInfo->GetLib(); + xStdLib->SetName( rName ); + xStdLib->SetModified( TRUE ); + } + bBasMgrModified = TRUE; + return TRUE; + } + return FALSE; +} + +String BasicManager::GetLibName( USHORT nLib ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pLibInfo = pLibs->GetObject( nLib ); + DBG_ASSERT( pLibInfo, "Lib?!" ); + if ( pLibInfo ) + return pLibInfo->GetLibName(); + return String(); +} + +StarBASIC* BasicManager::CreateLib( const String& rLibName ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + if ( GetLib( rLibName ) ) + return 0; + + BasicLibInfo* pLibInfo = CreateLibInfo(); + StarBASIC* pNew = new StarBASIC( GetStdLib() ); + GetStdLib()->Insert( pNew ); + pNew->SetFlag( SBX_EXTSEARCH | SBX_DONTSTORE ); + pLibInfo->SetLib( pNew ); + pLibInfo->SetLibName( rLibName ); + pLibInfo->GetLib()->SetName( rLibName ); + return pLibInfo->GetLib(); +} + +// For XML import/export: +StarBASIC* BasicManager::CreateLib + ( const String& rLibName, const String& Password, const String& LinkTargetURL ) +{ + // Ask if lib exists because standard lib is always there + StarBASIC* pLib = GetLib( rLibName ); + if( !pLib ) + { + if( LinkTargetURL.Len() != 0 ) + { + SotStorageRef xStorage = new SotStorage( FALSE, LinkTargetURL, STREAM_READ | STREAM_SHARE_DENYWRITE ); + if( !xStorage->GetError() ) + { + pLib = AddLib( *xStorage, rLibName, TRUE ); + + } + + DBG_ASSERT( pLib, "XML Import: Linked basic library could not be loaded"); + } + else + { + pLib = CreateLib( rLibName ); + if( Password.Len() != 0 ) + { + BasicLibInfo* pLibInfo = FindLibInfo( pLib ); + pLibInfo ->SetPassword( Password ); + } + } + //ExternalSourceURL ? + } + return pLib; +} + +StarBASIC* BasicManager::CreateLibForLibContainer( const String& rLibName, + const Reference< XLibraryContainer >& xScriptCont ) +{ + DBG_CHKTHIS( BasicManager, 0 ); + if ( GetLib( rLibName ) ) + return 0; + + BasicLibInfo* pLibInfo = CreateLibInfo(); + StarBASIC* pNew = new StarBASIC( GetStdLib() ); + GetStdLib()->Insert( pNew ); + pNew->SetFlag( SBX_EXTSEARCH | SBX_DONTSTORE ); + pLibInfo->SetLib( pNew ); + pLibInfo->SetLibName( rLibName ); + pLibInfo->GetLib()->SetName( rLibName ); + pLibInfo->SetLibraryContainer( xScriptCont ); + return pNew; +} + + +BasicLibInfo* BasicManager::FindLibInfo( StarBASIC* pBasic ) const +{ + DBG_CHKTHIS( BasicManager, 0 ); + + BasicLibInfo* pInf = ((BasicManager*)this)->pLibs->First(); + while ( pInf ) + { + if ( pInf->GetLib() == pBasic ) + return pInf; + + pInf = ((BasicManager*)this)->pLibs->Next(); + } + return 0; +} + +//===================================================================== + +class ModuleInfo_Impl : public ModuleInfoHelper +{ + OUString maName; + OUString maLanguage; + OUString maSource; + +public: + ModuleInfo_Impl( const OUString& aName, const OUString& aLanguage, const OUString& aSource ) + : maName( aName ), maLanguage( aLanguage), maSource( aSource ) {} + + // Methods XStarBasicModuleInfo + virtual OUString SAL_CALL getName() throw(RuntimeException) + { return maName; } + virtual OUString SAL_CALL getLanguage() throw(RuntimeException) + { return maLanguage; } + virtual OUString SAL_CALL getSource() throw(RuntimeException) + { return maSource; } +}; + + +//===================================================================== + +class DialogInfo_Impl : public DialogInfoHelper +{ + OUString maName; + Sequence< sal_Int8 > mData; + +public: + DialogInfo_Impl( const OUString& aName, Sequence< sal_Int8 > Data ) + : maName( aName ), mData( Data ) {} + + // Methods XStarBasicDialogInfo + virtual OUString SAL_CALL getName() throw(RuntimeException) + { return maName; } + virtual Sequence< sal_Int8 > SAL_CALL getData() throw(RuntimeException) + { return mData; } +}; + + +//===================================================================== + +class LibraryInfo_Impl : public LibraryInfoHelper +{ + OUString maName; + Reference< XNameContainer > mxModuleContainer; + Reference< XNameContainer > mxDialogContainer; + OUString maPassword; + OUString maExternaleSourceURL; + OUString maLinkTargetURL; + +public: + LibraryInfo_Impl + ( + const OUString& aName, + Reference< XNameContainer > xModuleContainer, + Reference< XNameContainer > xDialogContainer, + const OUString& aPassword, + const OUString& aExternaleSourceURL, + const OUString& aLinkTargetURL + ) + : maName( aName ) + , mxModuleContainer( xModuleContainer ) + , mxDialogContainer( xDialogContainer ) + , maPassword( aPassword ) + , maExternaleSourceURL( aExternaleSourceURL ) + , maLinkTargetURL( aLinkTargetURL ) + {} + + // Methods XStarBasicLibraryInfo + virtual OUString SAL_CALL getName() throw(RuntimeException) + { return maName; } + virtual Reference< XNameContainer > SAL_CALL getModuleContainer() throw(RuntimeException) + { return mxModuleContainer; } + virtual Reference< XNameContainer > SAL_CALL getDialogContainer() throw(RuntimeException) + { return mxDialogContainer; } + virtual OUString SAL_CALL getPassword() throw(RuntimeException) + { return maPassword; } + virtual OUString SAL_CALL getExternalSourceURL() throw(RuntimeException) + { return maExternaleSourceURL; } + virtual OUString SAL_CALL getLinkTargetURL() throw(RuntimeException) + { return maLinkTargetURL; } +}; + +//===================================================================== + +class ModuleContainer_Impl : public NameContainerHelper +{ + StarBASIC* mpLib; + +public: + ModuleContainer_Impl( StarBASIC* pLib ) + :mpLib( pLib ) {} + + // Methods XElementAccess + virtual Type SAL_CALL getElementType() + throw(RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw(RuntimeException); + + // Methods XNameAccess + virtual Any SAL_CALL getByName( const OUString& aName ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException); + virtual Sequence< OUString > SAL_CALL getElementNames() + throw(RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) + throw(RuntimeException); + + // Methods XNameReplace + virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException); + + // Methods XNameContainer + virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException); + virtual void SAL_CALL removeByName( const OUString& Name ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException); +}; + +// Methods XElementAccess +Type ModuleContainer_Impl::getElementType() + throw(RuntimeException) +{ + Type aModuleType = ::getCppuType( (const Reference< XStarBasicModuleInfo > *)0 ); + return aModuleType; +} + +sal_Bool ModuleContainer_Impl::hasElements() + throw(RuntimeException) +{ + SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL; + return pMods && pMods->Count() > 0; +} + +// Methods XNameAccess +Any ModuleContainer_Impl::getByName( const OUString& aName ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException) +{ + SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL; + if( !pMod ) + throw NoSuchElementException(); + Reference< XStarBasicModuleInfo > xMod = (XStarBasicModuleInfo*)new ModuleInfo_Impl + ( aName, OUString( RTL_CONSTASCII_USTRINGPARAM( "StarBasic" )), pMod->GetSource32() ); + Any aRetAny; + aRetAny <<= xMod; + return aRetAny; +} + +Sequence< OUString > ModuleContainer_Impl::getElementNames() + throw(RuntimeException) +{ + SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL; + USHORT nMods = pMods ? pMods->Count() : 0; + Sequence< OUString > aRetSeq( nMods ); + OUString* pRetSeq = aRetSeq.getArray(); + for( USHORT i = 0 ; i < nMods ; i++ ) + { + SbxVariable* pMod = pMods->Get( i ); + pRetSeq[i] = OUString( pMod->GetName() ); + } + return aRetSeq; +} + +sal_Bool ModuleContainer_Impl::hasByName( const OUString& aName ) + throw(RuntimeException) +{ + SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL; + sal_Bool bRet = (pMod != NULL); + return bRet; +} + + +// Methods XNameReplace +void ModuleContainer_Impl::replaceByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) +{ + removeByName( aName ); + insertByName( aName, aElement ); +} + + +// Methods XNameContainer +void ModuleContainer_Impl::insertByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) +{ + Type aModuleType = ::getCppuType( (const Reference< XStarBasicModuleInfo > *)0 ); + Type aAnyType = aElement.getValueType(); + if( aModuleType != aAnyType ) + throw IllegalArgumentException(); + Reference< XStarBasicModuleInfo > xMod; + aElement >>= xMod; + mpLib->MakeModule32( aName, xMod->getSource() ); +} + +void ModuleContainer_Impl::removeByName( const OUString& Name ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException) +{ + SbModule* pMod = mpLib ? mpLib->FindModule( Name ) : NULL; + if( !pMod ) + throw NoSuchElementException(); + mpLib->Remove( pMod ); +} + + +//===================================================================== + +Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog ) +{ + SvMemoryStream aMemStream; + pDialog->Store( aMemStream ); + sal_Int32 nLen = aMemStream.Tell(); + Sequence< sal_Int8 > aData( nLen ); + sal_Int8* pDestData = aData.getArray(); + const sal_Int8* pSrcData = (const sal_Int8*)aMemStream.GetData(); + rtl_copyMemory( pDestData, pSrcData, nLen ); + return aData; +} + +SbxObject* implCreateDialog( Sequence< sal_Int8 > aData ) +{ + sal_Int8* pData = aData.getArray(); + SvMemoryStream aMemStream( pData, aData.getLength(), STREAM_READ ); + SbxObject* pDialog = (SbxObject*)SbxBase::Load( aMemStream ); + return pDialog; +} + +// HACK! Because this value is defined in basctl/inc/vcsbxdef.hxx +// which we can't include here, we have to use the value directly +#define SBXID_DIALOG 101 + + +class DialogContainer_Impl : public NameContainerHelper +{ + StarBASIC* mpLib; + +public: + DialogContainer_Impl( StarBASIC* pLib ) + :mpLib( pLib ) {} + + // Methods XElementAccess + virtual Type SAL_CALL getElementType() + throw(RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw(RuntimeException); + + // Methods XNameAccess + virtual Any SAL_CALL getByName( const OUString& aName ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException); + virtual Sequence< OUString > SAL_CALL getElementNames() + throw(RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) + throw(RuntimeException); + + // Methods XNameReplace + virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException); + + // Methods XNameContainer + virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException); + virtual void SAL_CALL removeByName( const OUString& Name ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException); +}; + +// Methods XElementAccess +Type DialogContainer_Impl::getElementType() + throw(RuntimeException) +{ + Type aModuleType = ::getCppuType( (const Reference< XStarBasicDialogInfo > *)0 ); + return aModuleType; +} + +sal_Bool DialogContainer_Impl::hasElements() + throw(RuntimeException) +{ + sal_Bool bRet = sal_False; + + mpLib->GetAll( SbxCLASS_OBJECT ); + sal_Int16 nCount = mpLib->GetObjects()->Count(); + for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ ) + { + SbxVariable* pVar = mpLib->GetObjects()->Get( nObj ); + if ( pVar->ISA( SbxObject ) && ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) + { + bRet = sal_True; + break; + } + } + return bRet; +} + +// Methods XNameAccess +Any DialogContainer_Impl::getByName( const OUString& aName ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException) +{ + SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ); + if( !( pVar && pVar->ISA( SbxObject ) && + ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) ) + { + throw NoSuchElementException(); + } + + Reference< XStarBasicDialogInfo > xDialog = + (XStarBasicDialogInfo*)new DialogInfo_Impl + ( aName, implGetDialogData( (SbxObject*)pVar ) ); + + Any aRetAny; + aRetAny <<= xDialog; + return aRetAny; +} + +Sequence< OUString > DialogContainer_Impl::getElementNames() + throw(RuntimeException) +{ + mpLib->GetAll( SbxCLASS_OBJECT ); + sal_Int16 nCount = mpLib->GetObjects()->Count(); + Sequence< OUString > aRetSeq( nCount ); + OUString* pRetSeq = aRetSeq.getArray(); + sal_Int32 nDialogCounter = 0; + + for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ ) + { + SbxVariable* pVar = mpLib->GetObjects()->Get( nObj ); + if ( pVar->ISA( SbxObject ) && ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) + { + pRetSeq[ nDialogCounter ] = OUString( pVar->GetName() ); + nDialogCounter++; + } + } + aRetSeq.realloc( nDialogCounter ); + return aRetSeq; +} + +sal_Bool DialogContainer_Impl::hasByName( const OUString& aName ) + throw(RuntimeException) +{ + sal_Bool bRet = sal_False; + SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ); + if( pVar && pVar->ISA( SbxObject ) && + ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) + { + bRet = sal_True; + } + return bRet; +} + + +// Methods XNameReplace +void DialogContainer_Impl::replaceByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) +{ + removeByName( aName ); + insertByName( aName, aElement ); +} + + +// Methods XNameContainer +void DialogContainer_Impl::insertByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) +{ + (void)aName; + Type aModuleType = ::getCppuType( (const Reference< XStarBasicDialogInfo > *)0 ); + Type aAnyType = aElement.getValueType(); + if( aModuleType != aAnyType ) + throw IllegalArgumentException(); + Reference< XStarBasicDialogInfo > xMod; + aElement >>= xMod; + SbxObjectRef xDialog = implCreateDialog( xMod->getData() ); + mpLib->Insert( xDialog ); +} + +void DialogContainer_Impl::removeByName( const OUString& Name ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException) +{ + (void)Name; + SbxVariable* pVar = mpLib->GetObjects()->Find( Name, SbxCLASS_DONTCARE ); + if( !( pVar && pVar->ISA( SbxObject ) && + ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) ) + { + throw NoSuchElementException(); + } + mpLib->Remove( pVar ); +} + + +//===================================================================== + + +class LibraryContainer_Impl : public NameContainerHelper +{ + BasicManager* mpMgr; + +public: + LibraryContainer_Impl( BasicManager* pMgr ) + :mpMgr( pMgr ) {} + + // Methods XElementAccess + virtual Type SAL_CALL getElementType() + throw(RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw(RuntimeException); + + // Methods XNameAccess + virtual Any SAL_CALL getByName( const OUString& aName ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException); + virtual Sequence< OUString > SAL_CALL getElementNames() + throw(RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) + throw(RuntimeException); + + // Methods XNameReplace + virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException); + + // Methods XNameContainer + virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException); + virtual void SAL_CALL removeByName( const OUString& Name ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException); +}; + + +// Methods XElementAccess +Type LibraryContainer_Impl::getElementType() + throw(RuntimeException) +{ + Type aType = ::getCppuType( (const Reference< XStarBasicLibraryInfo > *)0 ); + return aType; +} + +sal_Bool LibraryContainer_Impl::hasElements() + throw(RuntimeException) +{ + sal_Int32 nLibs = mpMgr->GetLibCount(); + sal_Bool bRet = (nLibs > 0); + return bRet; +} + +// Methods XNameAccess +Any LibraryContainer_Impl::getByName( const OUString& aName ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException) +{ + Any aRetAny; + if( !mpMgr->HasLib( aName ) ) + throw NoSuchElementException(); + StarBASIC* pLib = mpMgr->GetLib( aName ); + + Reference< XNameContainer > xModuleContainer = + (XNameContainer*)new ModuleContainer_Impl( pLib ); + + Reference< XNameContainer > xDialogContainer; + (XNameContainer*)new DialogContainer_Impl( pLib ); + + BasicLibInfo* pLibInfo = mpMgr->FindLibInfo( pLib ); + + OUString aPassword = pLibInfo->GetPassword(); + + // TODO Nur extern-Info liefern! + OUString aExternaleSourceURL; + OUString aLinkTargetURL; + if( pLibInfo->IsReference() ) + aLinkTargetURL = pLibInfo->GetStorageName(); + else if( pLibInfo->IsExtern() ) + aExternaleSourceURL = pLibInfo->GetStorageName(); + + Reference< XStarBasicLibraryInfo > xLibInfo = new LibraryInfo_Impl + ( + aName, + xModuleContainer, + xDialogContainer, + aPassword, + aExternaleSourceURL, + aLinkTargetURL + ); + + aRetAny <<= xLibInfo; + return aRetAny; +} + +Sequence< OUString > LibraryContainer_Impl::getElementNames() + throw(RuntimeException) +{ + USHORT nLibs = mpMgr->GetLibCount(); + Sequence< OUString > aRetSeq( nLibs ); + OUString* pRetSeq = aRetSeq.getArray(); + for( USHORT i = 0 ; i < nLibs ; i++ ) + { + pRetSeq[i] = OUString( mpMgr->GetLibName( i ) ); + } + return aRetSeq; +} + +sal_Bool LibraryContainer_Impl::hasByName( const OUString& aName ) + throw(RuntimeException) +{ + sal_Bool bRet = mpMgr->HasLib( aName ); + return bRet; +} + +// Methods XNameReplace +void LibraryContainer_Impl::replaceByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) +{ + removeByName( aName ); + insertByName( aName, aElement ); +} + +// Methods XNameContainer +void LibraryContainer_Impl::insertByName( const OUString& aName, const Any& aElement ) + throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) +{ + (void)aName; + (void)aElement; + // TODO: Insert a complete Library?! +} + +void LibraryContainer_Impl::removeByName( const OUString& Name ) + throw(NoSuchElementException, WrappedTargetException, RuntimeException) +{ + StarBASIC* pLib = mpMgr->GetLib( Name ); + if( !pLib ) + throw NoSuchElementException(); + USHORT nLibId = mpMgr->GetLibId( Name ); + mpMgr->RemoveLib( nLibId ); +} + +//===================================================================== + +typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper; + + +class StarBasicAccess_Impl : public StarBasicAccessHelper +{ + BasicManager* mpMgr; + Reference< XNameContainer > mxLibContainer; + +public: + StarBasicAccess_Impl( BasicManager* pMgr ) + :mpMgr( pMgr ) {} + +public: + + // Methods + virtual Reference< XNameContainer > SAL_CALL getLibraryContainer() + throw(RuntimeException); + virtual void SAL_CALL createLibrary( const OUString& LibName, const OUString& Password, + const OUString& ExternalSourceURL, const OUString& LinkTargetURL ) + throw(ElementExistException, RuntimeException); + virtual void SAL_CALL addModule( const OUString& LibraryName, const OUString& ModuleName, + const OUString& Language, const OUString& Source ) + throw(NoSuchElementException, RuntimeException); + virtual void SAL_CALL addDialog( const OUString& LibraryName, const OUString& DialogName, + const Sequence< sal_Int8 >& Data ) + throw(NoSuchElementException, RuntimeException); + +}; + +Reference< XNameContainer > SAL_CALL StarBasicAccess_Impl::getLibraryContainer() + throw(RuntimeException) +{ + if( !mxLibContainer.is() ) + mxLibContainer = (XNameContainer*)new LibraryContainer_Impl( mpMgr ); + return mxLibContainer; +} + +void SAL_CALL StarBasicAccess_Impl::createLibrary +( + const OUString& LibName, + const OUString& Password, + const OUString& ExternalSourceURL, + const OUString& LinkTargetURL +) + throw(ElementExistException, RuntimeException) +{ + (void)ExternalSourceURL; +#ifdef DBG_UTIL + StarBASIC* pLib = +#endif + mpMgr->CreateLib( LibName, Password, LinkTargetURL ); + DBG_ASSERT( pLib, "XML Import: Basic library could not be created"); +} + +void SAL_CALL StarBasicAccess_Impl::addModule +( + const OUString& LibraryName, + const OUString& ModuleName, + const OUString& Language, + const OUString& Source +) + throw(NoSuchElementException, RuntimeException) +{ + (void)Language; + StarBASIC* pLib = mpMgr->GetLib( LibraryName ); + DBG_ASSERT( pLib, "XML Import: Lib for module unknown"); + if( pLib ) + pLib->MakeModule32( ModuleName, Source ); +} + +void SAL_CALL StarBasicAccess_Impl::addDialog +( + const OUString& LibraryName, + const OUString& DialogName, + const Sequence< sal_Int8 >& Data +) + throw(NoSuchElementException, RuntimeException) +{ + (void)LibraryName; + (void)DialogName; + (void)Data; +} + +// Basic XML Import/Export +Reference< XStarBasicAccess > getStarBasicAccess( BasicManager* pMgr ) +{ + Reference< XStarBasicAccess > xRet = + new StarBasicAccess_Impl( (BasicManager*)pMgr ); + return xRet; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/basmgr/makefile.mk b/bf_basic/source/basmgr/makefile.mk new file mode 100644 index 00000000000..bfa54fc07b4 --- /dev/null +++ b/bf_basic/source/basmgr/makefile.mk @@ -0,0 +1,49 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=binfilter +TARGET=basic_basicmgr +ENABLE_EXCEPTIONS=TRUE + +NO_HIDS=TRUE + +# --- Settings ----------------------------------------------------------- + +.INCLUDE : settings.mk + +INC+= -I$(PRJ)$/inc$/bf_basic + +# --- Allgemein ----------------------------------------------------------- + +SLOFILES= \ + $(SLO)$/basmgr.obj + +# --- Targets ------------------------------------------------------------- + +.INCLUDE : target.mk diff --git a/bf_basic/source/classes/image.cxx b/bf_basic/source/classes/image.cxx new file mode 100644 index 00000000000..c41c51a6448 --- /dev/null +++ b/bf_basic/source/classes/image.cxx @@ -0,0 +1,282 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include "sbx.hxx" +#include "sb.hxx" +#include // memset() etc +#include "image.hxx" +#include "codegen.hxx" + +namespace binfilter { + +SbiImage::SbiImage() +{ + pStringOff = NULL; + pStrings = NULL; + pCode = NULL; + pLegacyPCode = NULL; + nFlags = 0; + nStrings = 0; + nStringSize= 0; + nCodeSize = 0; + nLegacyCodeSize = + nDimBase = 0; + bInit = + bError = FALSE; + bFirstInit = TRUE; + eCharSet = osl_getThreadTextEncoding(); +} + +SbiImage::~SbiImage() +{ + Clear(); +} + +void SbiImage::Clear() +{ + delete[] pStringOff; + delete[] pStrings; + delete[] pCode; + ReleaseLegacyBuffer(); + pStringOff = NULL; + pStrings = NULL; + pCode = NULL; + nFlags = 0; + nStrings = 0; + nStringSize= 0; + nLegacyCodeSize = 0; + nCodeSize = 0; + eCharSet = osl_getThreadTextEncoding(); + nDimBase = 0; + bError = FALSE; +} + +/************************************************************************** +* +* Service routes for saving and loading +* +**************************************************************************/ + +BOOL SbiGood( SvStream& r ) +{ + return BOOL( !r.IsEof() && r.GetError() == SVSTREAM_OK ); +} + +BOOL SbiImage::Load( SvStream& r, UINT32& nVersion ) +{ + + UINT16 nSign, nCount; + UINT32 nLen, nOff; + + Clear(); + // Master-Record einlesen + r >> nSign >> nLen >> nCount; + ULONG nLast = r.Tell() + nLen; + UINT32 nCharSet; // System-Zeichensatz + UINT32 lDimBase; + UINT16 nReserved1; + UINT32 nReserved2; + UINT32 nReserved3; + BOOL bBadVer = FALSE; + if( nSign == B_MODULE ) + { + r >> nVersion >> nCharSet >> lDimBase + >> nFlags >> nReserved1 >> nReserved2 >> nReserved3; + eCharSet = (CharSet) nCharSet; + eCharSet = GetSOLoadTextEncoding( eCharSet ); + bBadVer = BOOL( nVersion > B_CURVERSION ); + nDimBase = (USHORT) lDimBase; + } + + bool bLegacy = ( nVersion < B_EXT_IMG_VERSION ); + + ULONG nNext; + while( ( nNext = r.Tell() ) < nLast ) + { + short i; + + r >> nSign >> nLen >> nCount; + nNext += nLen + 8; + if( r.GetError() == SVSTREAM_OK ) + switch( nSign ) + { + case B_NAME: + r.ReadByteString( aName, eCharSet ); + break; + case B_COMMENT: + r.ReadByteString( aComment, eCharSet ); + break; + case B_SOURCE: + { + String aTmp; + r.ReadByteString( aTmp, eCharSet ); + aOUSource = aTmp; + break; + } +#ifdef EXTENDED_BINARY_MODULES + case B_EXTSOURCE: + { + for( UINT16 j = 0 ; j < nCount ; j++ ) + { + String aTmp; + r.ReadByteString( aTmp, eCharSet ); + aOUSource += aTmp; + } + break; + } +#endif + case B_PCODE: + if( bBadVer ) break; + pCode = new char[ nLen ]; + nCodeSize = nLen; + r.Read( pCode, nCodeSize ); + if ( bLegacy ) + { + ReleaseLegacyBuffer(); // release any previously held buffer + nLegacyCodeSize = (UINT16) nCodeSize; + pLegacyPCode = pCode; + + PCodeBuffConvertor< UINT16, UINT32 > aLegacyToNew( (BYTE*)pLegacyPCode, nLegacyCodeSize ); + aLegacyToNew.convert(); + pCode = (char*)aLegacyToNew.GetBuffer(); + nCodeSize = aLegacyToNew.GetSize(); + // we don't release the legacy buffer + // right now, thats because the module + // needs it to fix up the method + // nStart members. When that is done + // the module can release the buffer + // or it can wait until this routine + // is called again or when this class // destructs all of which will trigger + // release of the buffer. + } + break; + case B_PUBLICS: + case B_POOLDIR: + case B_SYMPOOL: + case B_LINERANGES: + break; + case B_STRINGPOOL: + if( bBadVer ) break; + MakeStrings( nCount ); + for( i = 0; i < nStrings && SbiGood( r ); i++ ) + { + r >> nOff; + pStringOff[ i ] = (USHORT) nOff; + } + r >> nLen; + if( SbiGood( r ) ) + { + delete [] pStrings; + pStrings = new sal_Unicode[ nLen ]; + nStringSize = (USHORT) nLen; + + char* pByteStrings = new char[ nLen ]; + r.Read( pByteStrings, nStringSize ); + for( short j = 0; j < nStrings; j++ ) + { + USHORT nOff2 = (USHORT) pStringOff[ j ]; + String aStr( pByteStrings + nOff2, eCharSet ); + memcpy( pStrings + nOff2, aStr.GetBuffer(), (aStr.Len() + 1) * sizeof( sal_Unicode ) ); + } + delete[] pByteStrings; + } break; + case B_MODEND: + goto done; + default: + break; + } + else + break; + r.Seek( nNext ); + } +done: + r.Seek( nLast ); + if( !SbiGood( r ) ) + bError = TRUE; + return BOOL( !bError ); +} + +/************************************************************************** +* +* Routinen, die auch vom Compiler gerufen werden +* +**************************************************************************/ + +void SbiImage::MakeStrings( short nSize ) +{ + nStrings = 0; + nStringIdx = 0; + nStringOff = 0; + nStringSize = 1024; + pStrings = new sal_Unicode[ nStringSize ]; + pStringOff = new UINT32[ nSize ]; + if( pStrings && pStringOff ) + { + nStrings = nSize; + memset( pStringOff, 0, nSize * sizeof( UINT32 ) ); + memset( pStrings, 0, nStringSize * sizeof( sal_Unicode ) ); + } + else + bError = TRUE; +} + +/************************************************************************** +* +* Zugriffe auf das Image +* +**************************************************************************/ + +const SbxObject* SbiImage::FindType (String aTypeName) const +{ + return rTypes.Is() ? (SbxObject*)rTypes->Find(aTypeName,SbxCLASS_OBJECT) : NULL; +} + +UINT16 +SbiImage::CalcLegacyOffset( INT32 nOffset ) +{ + return SbiCodeGen::calcLegacyOffSet( (BYTE*)pCode, nOffset ) ; +} +UINT32 +SbiImage::CalcNewOffset( INT16 nOffset ) +{ + return SbiCodeGen::calcNewOffSet( (BYTE*)pLegacyPCode, nOffset ) ; +} + +void +SbiImage::ReleaseLegacyBuffer() +{ + delete[] pLegacyPCode; + pLegacyPCode = NULL; + nLegacyCodeSize = 0; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/classes/makefile.mk b/bf_basic/source/classes/makefile.mk new file mode 100644 index 00000000000..51a6dc023db --- /dev/null +++ b/bf_basic/source/classes/makefile.mk @@ -0,0 +1,59 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=binfilter +TARGET=basic_classes + +NO_HIDS=TRUE + +# --- Settings ----------------------------------------------------------- + +ENABLE_EXCEPTIONS=TRUE + +.INCLUDE : settings.mk + +INC+= -I$(PRJ)$/inc$/bf_basic + +# --- Allgemein ----------------------------------------------------------- + +SLOFILES=\ + $(SLO)$/sb.obj \ + $(SLO)$/sbxmod.obj \ + $(SLO)$/sbunoobj.obj \ + $(SLO)$/image.obj \ + $(SLO)$/sbintern.obj \ + +# $(SLO)$/propacc.obj \ + $(SLO)$/disas.obj \ + $(SLO)$/eventatt.obj + +# --- Targets ------------------------------------------------------------- + +.INCLUDE : target.mk + diff --git a/bf_basic/source/classes/sb.cxx b/bf_basic/source/classes/sb.cxx new file mode 100644 index 00000000000..38c6a689425 --- /dev/null +++ b/bf_basic/source/classes/sb.cxx @@ -0,0 +1,1346 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "sb.hxx" +#include +#include + +#include +#ifndef __RSC //autogen +#include +#endif +#include +#include +#include +#include "sbunoobj.hxx" +#include "sbjsmeth.hxx" +#include "sbjsmod.hxx" +#include "sbintern.hxx" +#include "image.hxx" +#include "filefmt.hxx" + +#include + +namespace binfilter { + +TYPEINIT1(StarBASIC,SbxObject) + +#define RTLNAME "@SBRTL" + + +//======================================================================== +// Array zur Umrechnung SFX <-> VB-Fehlercodes anlegen + +struct SFX_VB_ErrorItem +{ + USHORT nErrorVB; + SbError nErrorSFX; +}; + +const SFX_VB_ErrorItem SFX_VB_ErrorTab[] = +{ + { 1, SbERR_BASIC_EXCEPTION }, // #87844 Map exception to error code 1 + { 2, SbERR_SYNTAX }, + { 3, SbERR_NO_GOSUB }, + { 4, SbERR_REDO_FROM_START }, + { 5, SbERR_BAD_ARGUMENT }, + { 6, SbERR_MATH_OVERFLOW }, + { 7, SbERR_NO_MEMORY }, + { 8, SbERR_ALREADY_DIM }, + { 9, SbERR_OUT_OF_RANGE }, + { 10, SbERR_DUPLICATE_DEF }, + { 11, SbERR_ZERODIV }, + { 12, SbERR_VAR_UNDEFINED }, + { 13, SbERR_CONVERSION }, + { 14, SbERR_BAD_PARAMETER }, + { 18, SbERR_USER_ABORT }, + { 20, SbERR_BAD_RESUME }, + { 28, SbERR_STACK_OVERFLOW }, + { 35, SbERR_PROC_UNDEFINED }, + { 48, SbERR_BAD_DLL_LOAD }, + { 49, SbERR_BAD_DLL_CALL }, + { 51, SbERR_INTERNAL_ERROR }, + { 52, SbERR_BAD_CHANNEL }, + { 53, SbERR_FILE_NOT_FOUND }, + { 54, SbERR_BAD_FILE_MODE }, + { 55, SbERR_FILE_ALREADY_OPEN }, + { 57, SbERR_IO_ERROR }, + { 58, SbERR_FILE_EXISTS }, + { 59, SbERR_BAD_RECORD_LENGTH }, + { 61, SbERR_DISK_FULL }, + { 62, SbERR_READ_PAST_EOF }, + { 63, SbERR_BAD_RECORD_NUMBER }, + { 67, SbERR_TOO_MANY_FILES }, + { 68, SbERR_NO_DEVICE }, + { 70, SbERR_ACCESS_DENIED }, + { 71, SbERR_NOT_READY }, + { 73, SbERR_NOT_IMPLEMENTED }, + { 74, SbERR_DIFFERENT_DRIVE }, + { 75, SbERR_ACCESS_ERROR }, + { 76, SbERR_PATH_NOT_FOUND }, + { 91, SbERR_NO_OBJECT }, + { 93, SbERR_BAD_PATTERN }, + { 94, SBERR_IS_NULL }, + { 250, SbERR_DDE_ERROR }, + { 280, SbERR_DDE_WAITINGACK }, + { 281, SbERR_DDE_OUTOFCHANNELS }, + { 282, SbERR_DDE_NO_RESPONSE }, + { 283, SbERR_DDE_MULT_RESPONSES }, + { 284, SbERR_DDE_CHANNEL_LOCKED }, + { 285, SbERR_DDE_NOTPROCESSED }, + { 286, SbERR_DDE_TIMEOUT }, + { 287, SbERR_DDE_USER_INTERRUPT }, + { 288, SbERR_DDE_BUSY }, + { 289, SbERR_DDE_NO_DATA }, + { 290, SbERR_DDE_WRONG_DATA_FORMAT }, + { 291, SbERR_DDE_PARTNER_QUIT }, + { 292, SbERR_DDE_CONV_CLOSED }, + { 293, SbERR_DDE_NO_CHANNEL }, + { 294, SbERR_DDE_INVALID_LINK }, + { 295, SbERR_DDE_QUEUE_OVERFLOW }, + { 296, SbERR_DDE_LINK_ALREADY_EST }, + { 297, SbERR_DDE_LINK_INV_TOPIC }, + { 298, SbERR_DDE_DLL_NOT_FOUND }, + { 323, SbERR_CANNOT_LOAD }, + { 341, SbERR_BAD_INDEX }, + { 366, SbERR_NO_ACTIVE_OBJECT }, + { 380, SbERR_BAD_PROP_VALUE }, + { 382, SbERR_PROP_READONLY }, + { 394, SbERR_PROP_WRITEONLY }, + { 420, SbERR_INVALID_OBJECT }, + { 423, SbERR_NO_METHOD }, + { 424, SbERR_NEEDS_OBJECT }, + { 425, SbERR_INVALID_USAGE_OBJECT }, + { 430, SbERR_NO_OLE }, + { 438, SbERR_BAD_METHOD }, + { 440, SbERR_OLE_ERROR }, + { 445, SbERR_BAD_ACTION }, + { 446, SbERR_NO_NAMED_ARGS }, + { 447, SbERR_BAD_LOCALE }, + { 448, SbERR_NAMED_NOT_FOUND }, + { 449, SbERR_NOT_OPTIONAL }, + { 450, SbERR_WRONG_ARGS }, + { 451, SbERR_NOT_A_COLL }, + { 452, SbERR_BAD_ORDINAL }, + { 453, SbERR_DLLPROC_NOT_FOUND }, + { 460, SbERR_BAD_CLIPBD_FORMAT }, + { 951, SbERR_UNEXPECTED }, + { 952, SbERR_EXPECTED }, + { 953, SbERR_SYMBOL_EXPECTED }, + { 954, SbERR_VAR_EXPECTED }, + { 955, SbERR_LABEL_EXPECTED }, + { 956, SbERR_LVALUE_EXPECTED }, + { 957, SbERR_VAR_DEFINED }, + { 958, SbERR_PROC_DEFINED }, + { 959, SbERR_LABEL_DEFINED }, + { 960, SbERR_UNDEF_VAR }, + { 961, SbERR_UNDEF_ARRAY }, + { 962, SbERR_UNDEF_PROC }, + { 963, SbERR_UNDEF_LABEL }, + { 964, SbERR_UNDEF_TYPE }, + { 965, SbERR_BAD_EXIT }, + { 966, SbERR_BAD_BLOCK }, + { 967, SbERR_BAD_BRACKETS }, + { 968, SbERR_BAD_DECLARATION }, + { 969, SbERR_BAD_PARAMETERS }, + { 970, SbERR_BAD_CHAR_IN_NUMBER }, + { 971, SbERR_MUST_HAVE_DIMS }, + { 972, SbERR_NO_IF }, + { 973, SbERR_NOT_IN_SUBR }, + { 974, SbERR_NOT_IN_MAIN }, + { 975, SbERR_WRONG_DIMS }, + { 976, SbERR_BAD_OPTION }, + { 977, SbERR_CONSTANT_REDECLARED }, + { 978, SbERR_PROG_TOO_LARGE }, + { 979, SbERR_NO_STRINGS_ARRAYS }, + { 1000, SbERR_PROPERTY_NOT_FOUND }, + { 1001, SbERR_METHOD_NOT_FOUND }, + { 1002, SbERR_ARG_MISSING }, + { 1003, SbERR_BAD_NUMBER_OF_ARGS }, + { 1004, SbERR_METHOD_FAILED }, + { 1005, SbERR_SETPROP_FAILED }, + { 1006, SbERR_GETPROP_FAILED }, + { 0xFFFF, 0xFFFFFFFFL } // End-Marke +}; + + +//////////////////////////////////////////////////////////////////////////// + +// Die StarBASIC-Factory hat einen Hack. Wenn ein SbModule eingerichtet wird, +// wird der Pointer gespeichert und an nachfolgende SbProperties/SbMethods +// uebergeben. Dadurch wird die Modul-Relationship wiederhergestellt. Das +// klappt aber nur, wenn ein Modul geladen wird. Fuer getrennt geladene +// Properties kann es Probleme geben! + +SbxBase* SbiFactory::Create( UINT16 nSbxId, UINT32 nCreator ) +{ + if( nCreator == SBXCR_SBX ) + { + String aEmpty; + switch( nSbxId ) + { + case SBXID_BASIC: + return new StarBASIC( NULL ); + case SBXID_BASICMOD: + return new SbModule( aEmpty ); + case SBXID_BASICPROP: + return new SbProperty( aEmpty, SbxVARIANT, NULL ); + case SBXID_BASICMETHOD: + return new SbMethod( aEmpty, SbxVARIANT, NULL ); + case SBXID_JSCRIPTMOD: + return new SbJScriptModule( aEmpty ); + case SBXID_JSCRIPTMETH: + return new SbJScriptMethod( aEmpty, SbxVARIANT, NULL ); + } + } + return NULL; +} + +SbxObject* SbiFactory::CreateObject( const String& rClass ) +{ + if( rClass.EqualsIgnoreCaseAscii( "StarBASIC" ) ) + return new StarBASIC( NULL ); + else + if( rClass.EqualsIgnoreCaseAscii( "StarBASICModule" ) ) + { + String aEmpty; + return new SbModule( aEmpty ); + } + else + if( rClass.EqualsIgnoreCaseAscii( "Collection" ) ) + { + String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") ); + return new BasicCollection( aCollectionName ); + } + else + return NULL; +} + + +// Factory class to create OLE objects +class SbOLEFactory : public SbxFactory +{ +public: + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxObject* CreateObject( const String& ); +}; + +SbxBase* SbOLEFactory::Create( UINT16, UINT32 ) +{ + // Not supported + return NULL; +} + +SbUnoObject* createOLEObject_Impl( const String& aType ); // sbunoobj.cxx + +SbxObject* SbOLEFactory::CreateObject( const String& rClassName ) +{ + SbxObject* pRet = createOLEObject_Impl( rClassName ); + return pRet; +} + + +// Factory class to create user defined objects (type command) +class SbTypeFactory : public SbxFactory +{ + SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ); + +public: + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxObject* CreateObject( const String& ); +}; + +SbxBase* SbTypeFactory::Create( UINT16, UINT32 ) +{ + // Not supported + return NULL; +} + +SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj ) +{ + SbxObject* pRet = new SbxObject( rTypeObj ); + pRet->PutObject( pRet ); + + // Copy the properties, not only the reference to them + SbxArray* pProps = pRet->GetProperties(); + UINT32 nCount = pProps->Count32(); + for( UINT32 i = 0 ; i < nCount ; i++ ) + { + SbxVariable* pVar = pProps->Get32( i ); + SbxProperty* pProp = PTR_CAST( SbxProperty, pVar ); + if( pProp ) + { + SbxProperty* pNewProp = new SbxProperty( *pProp ); + pProps->PutDirect( pNewProp, i ); + } + } + return pRet; +} + +SbxObject* SbTypeFactory::CreateObject( const String& rClassName ) +{ + SbxObject* pRet = NULL; + SbModule* pMod = pMOD; + if( pMod ) + { + const SbxObject* pObj = pMod->FindType( rClassName ); + if( pObj ) + pRet = cloneTypeObjectImpl( *pObj ); + } + return pRet; +} + +TYPEINIT1(SbClassModuleObject,SbModule) + +SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) + : SbModule( pClassModule->GetName() ) + , mpClassModule( pClassModule ) + , mbInitializeEventDone( false ) +{ + aOUSource = pClassModule->aOUSource; + aComment = pClassModule->aComment; + pImage = pClassModule->pImage; + + SetClassName( pClassModule->GetName() ); + + // Allow search only internally + ResetFlag( SBX_GBLSEARCH ); + + // Copy the methods from original class module + SbxArray* pClassMethods = pClassModule->GetMethods(); + UINT32 nMethodCount = pClassMethods->Count32(); + UINT32 i; + for( i = 0 ; i < nMethodCount ; i++ ) + { + SbxVariable* pVar = pClassMethods->Get32( i ); + + // Exclude SbIfaceMapperMethod to copy them in a second step + SbIfaceMapperMethod* pIfaceMethod = PTR_CAST( SbIfaceMapperMethod, pVar ); + if( !pIfaceMethod ) + { + SbMethod* pMethod = PTR_CAST(SbMethod, pVar ); + if( pMethod ) + { + USHORT nFlags_ = pMethod->GetFlags(); + pMethod->SetFlag( SBX_NO_BROADCAST ); + SbMethod* pNewMethod = new SbMethod( *pMethod ); + pNewMethod->ResetFlag( SBX_NO_BROADCAST ); + pMethod->SetFlags( nFlags_ ); + pNewMethod->pMod = this; + pNewMethod->SetParent( this ); + pMethods->PutDirect( pNewMethod, i ); + StartListening( pNewMethod->GetBroadcaster(), TRUE ); + } + } + } + + // Copy SbIfaceMapperMethod in a second step to ensure that + // the corresponding base methods have already been copied + for( i = 0 ; i < nMethodCount ; i++ ) + { + SbxVariable* pVar = pClassMethods->Get32( i ); + + SbIfaceMapperMethod* pIfaceMethod = PTR_CAST( SbIfaceMapperMethod, pVar ); + if( pIfaceMethod ) + { + SbMethod* pImplMethod = pIfaceMethod->getImplMethod(); + if( !pImplMethod ) + { + OSL_FAIL( "No ImplMethod" ); + continue; + } + + // Search for own copy of ImplMethod + String aImplMethodName = pImplMethod->GetName(); + SbxVariable* p = pMethods->Find( aImplMethodName, SbxCLASS_METHOD ); + SbMethod* pImplMethodCopy = p ? PTR_CAST(SbMethod,p) : NULL; + if( !pImplMethodCopy ) + { + OSL_FAIL( "Found no ImplMethod copy" ); + continue; + } + SbIfaceMapperMethod* pNewIfaceMethod = + new SbIfaceMapperMethod( pIfaceMethod->GetName(), pImplMethodCopy ); + pMethods->PutDirect( pNewIfaceMethod, i ); + } + } + + // Copy the properties from original class module + SbxArray* pClassProps = pClassModule->GetProperties(); + UINT32 nPropertyCount = pClassProps->Count32(); + for( i = 0 ; i < nPropertyCount ; i++ ) + { + SbxVariable* pVar = pClassProps->Get32( i ); + SbProcedureProperty* pProcedureProp = PTR_CAST( SbProcedureProperty, pVar ); + if( pProcedureProp ) + { + USHORT nFlags_ = pProcedureProp->GetFlags(); + pProcedureProp->SetFlag( SBX_NO_BROADCAST ); + SbProcedureProperty* pNewProp = new SbProcedureProperty + ( pProcedureProp->GetName(), pProcedureProp->GetType() ); + pNewProp->ResetFlag( SBX_NO_BROADCAST ); + pProcedureProp->SetFlags( nFlags_ ); + pProps->PutDirect( pNewProp, i ); + StartListening( pNewProp->GetBroadcaster(), TRUE ); + } + else + { + SbxProperty* pProp = PTR_CAST( SbxProperty, pVar ); + if( pProp ) + { + USHORT nFlags_ = pProp->GetFlags(); + pProp->SetFlag( SBX_NO_BROADCAST ); + SbxProperty* pNewProp = new SbxProperty( *pProp ); + pNewProp->ResetFlag( SBX_NO_BROADCAST ); + pNewProp->SetParent( this ); + pProps->PutDirect( pNewProp, i ); + pProp->SetFlags( nFlags_ ); + } + } + } +} + +SbClassModuleObject::~SbClassModuleObject() +{ + triggerTerminateEvent(); + + // Must be deleted by base class dtor because this data + // is not owned by the SbClassModuleObject object + pImage = NULL; +} + +void SbClassModuleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + bool bDone = false; + + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar ); + if( pProcProperty ) + { + bDone = true; + + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + String aProcName; + aProcName.AppendAscii( "Property Get " ); + aProcName += pProcProperty->GetName(); + + SbxVariable* pMeth = Find( aProcName, SbxCLASS_METHOD ); + if( pMeth ) + { + SbxValues aVals; + aVals.eType = SbxVARIANT; + pMeth->Get( aVals ); + pVar->Put( aVals ); + } + } + else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + { + SbxVariable* pMeth = NULL; + + bool bSet = pProcProperty->isSet(); + if( bSet ) + { + pProcProperty->setSet( false ); + + String aProcName; + aProcName.AppendAscii( "Property Set " ); + aProcName += pProcProperty->GetName(); + pMeth = Find( aProcName, SbxCLASS_METHOD ); + } + if( !pMeth ) // Let + { + String aProcName; + aProcName.AppendAscii( "Property Let " ); + aProcName += pProcProperty->GetName(); + pMeth = Find( aProcName, SbxCLASS_METHOD ); + } + + if( pMeth ) + { + // Setup parameters + SbxArrayRef xArray = new SbxArray; + xArray->Put( pMeth, 0 ); // Method as parameter 0 + xArray->Put( pVar, 1 ); + pMeth->SetParameters( xArray ); + + SbxValues aVals; + pMeth->Get( aVals ); + pMeth->SetParameters( NULL ); + } + } + } + } + + if( !bDone ) + SbModule::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); +} + +SbxVariable* SbClassModuleObject::Find( const XubString& rName, SbxClassType t ) +{ + SbxVariable* pRes = SbxObject::Find( rName, t ); + if( pRes ) + { + triggerInitializeEvent(); + + SbIfaceMapperMethod* pIfaceMapperMethod = PTR_CAST(SbIfaceMapperMethod,pRes); + if( pIfaceMapperMethod ) + { + pRes = pIfaceMapperMethod->getImplMethod(); + pRes->SetFlag( SBX_EXTFOUND ); + } + } + return pRes; +} + +void SbClassModuleObject::triggerInitializeEvent( void ) +{ + static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Class_Initialize") ); + + if( mbInitializeEventDone ) + return; + + mbInitializeEventDone = true; + + // Search method + SbxVariable* pMeth = SbxObject::Find( aInitMethodName, SbxCLASS_METHOD ); + if( pMeth ) + { + SbxValues aVals; + pMeth->Get( aVals ); + } +} + +void SbClassModuleObject::triggerTerminateEvent( void ) +{ + static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Class_Terminate") ); + + if( !mbInitializeEventDone || GetSbData()->bRunInit ) + return; + + // Search method + SbxVariable* pMeth = SbxObject::Find( aTermMethodName, SbxCLASS_METHOD ); + if( pMeth ) + { + SbxValues aVals; + pMeth->Get( aVals ); + } +} + + +void SbClassData::clear( void ) +{ + mxIfaces->Clear(); +} + +SbClassFactory::SbClassFactory( void ) +{ + String aDummyName; + xClassModules = new SbxObject( aDummyName ); +} + +SbClassFactory::~SbClassFactory() +{} + +SbxBase* SbClassFactory::Create( UINT16, UINT32 ) +{ + // Not supported + return NULL; +} + +SbxObject* SbClassFactory::CreateObject( const String& rClassName ) +{ + SbxVariable* pVar = xClassModules->Find( rClassName, SbxCLASS_DONTCARE ); + SbxObject* pRet = NULL; + if( pVar ) + { + SbModule* pMod = (SbModule*)pVar; + pRet = new SbClassModuleObject( pMod ); + } + return pRet; +} + +//////////////////////////////////////////////////////////////////////////// + +StarBASIC::StarBASIC( StarBASIC* p ) + : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ) +{ + SetParent( p ); + pLibInfo = NULL; + bNoRtl = bBreak = FALSE; + pModules = new SbxArray; + + if( !GetSbData()->nInst++ ) + { + pSBFAC = new SbiFactory; + AddFactory( pSBFAC ); + pUNOFAC = new SbUnoFactory; + AddFactory( pUNOFAC ); + pTYPEFAC = new SbTypeFactory; + AddFactory( pTYPEFAC ); + pCLASSFAC = new SbClassFactory; + AddFactory( pCLASSFAC ); + pOLEFAC = new SbOLEFactory; + AddFactory( pOLEFAC ); + } + + // Suche ueber StarBASIC ist immer global + SetFlag( SBX_GBLSEARCH ); +} + +// #51727 SetModified ueberladen, damit der Modified- +// Zustand nicht an den Parent weitergegeben wird. +void StarBASIC::SetModified( BOOL b ) +{ + SbxBase::SetModified( b ); +} + +//*** + +StarBASIC::~StarBASIC() +{ + if( !--GetSbData()->nInst ) + { + RemoveFactory( pSBFAC ); + pSBFAC = NULL; + RemoveFactory( pUNOFAC ); + pUNOFAC = NULL; + RemoveFactory( pTYPEFAC ); + pTYPEFAC = NULL; + RemoveFactory( pCLASSFAC ); + pCLASSFAC = NULL; + RemoveFactory( pOLEFAC ); + pOLEFAC = NULL; + } + + // #100326 Set Parent NULL in registered listeners + if( xUnoListeners.Is() ) + { + USHORT uCount = xUnoListeners->Count(); + for( USHORT i = 0 ; i < uCount ; i++ ) + { + SbxVariable* pListenerObj = xUnoListeners->Get( i ); + pListenerObj->SetParent( NULL ); + } + xUnoListeners = NULL; + } +} + +// operator new() wird hier versenkt, damit jeder eine Instanz +// anlegen kann, ohne neu zu bilden. + +void* StarBASIC::operator new( size_t n ) +{ + if( n < sizeof( StarBASIC ) ) + { + n = sizeof( StarBASIC ); + } + return ::operator new( n ); +} + +void StarBASIC::operator delete( void* p ) +{ + ::operator delete( p ); +} + +/************************************************************************** +* +* Erzeugen/Verwalten von Modulen +* +**************************************************************************/ + +SbModule* StarBASIC::MakeModule32( const String& rName, const ::rtl::OUString& rSrc ) +{ + SbModule* p = new SbModule( rName ); + p->SetSource32( rSrc ); + p->SetParent( this ); + pModules->Insert( p, pModules->Count() ); + SetModified( TRUE ); + return p; +} + +void StarBASIC::Insert( SbxVariable* pVar ) +{ + if( pVar->IsA( TYPE(SbModule) ) ) + { + pModules->Insert( pVar, pModules->Count() ); + pVar->SetParent( this ); + StartListening( pVar->GetBroadcaster(), TRUE ); + } + else + { + BOOL bWasModified = IsModified(); + SbxObject::Insert( pVar ); + if( !bWasModified && pVar->IsSet( SBX_DONTSTORE ) ) + SetModified( FALSE ); + } +} + +void StarBASIC::Remove( SbxVariable* pVar ) +{ + if( pVar->IsA( TYPE(SbModule) ) ) + { + // #87540 Can be last reference! + SbxVariableRef xVar = pVar; + pModules->Remove( pVar ); + pVar->SetParent( 0 ); + EndListening( pVar->GetBroadcaster() ); + } + else + SbxObject::Remove( pVar ); +} + +void StarBASIC::Clear() +{ + while( pModules->Count() ) + pModules->Remove( pModules->Count() - 1 ); +} + +SbModule* StarBASIC::FindModule( const String& rName ) +{ + for( USHORT i = 0; i < pModules->Count(); i++ ) + { + SbModule* p = (SbModule*) pModules->Get( i ); + if( p->GetName().EqualsIgnoreCaseAscii( rName ) ) + return p; + } + return NULL; +} + +// Init-Code aller Module ausfuehren (auch in inserteten Bibliotheken) +void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) +{ + OSL_FAIL( "StarBASIC::InitAllModules: dead code!" ); + // Alle Objekte ueberpruefen, ob es sich um ein Basic handelt + // Wenn ja, auch dort initialisieren + for ( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + { + SbxVariable* pVar = pObjs->Get( nObj ); + StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); + if( pBasic && pBasic != pBasicNotToInit ) + pBasic->InitAllModules(); + } +} + +// #88329 Put modules back to not initialised state to +// force reinitialisation at next start +void StarBASIC::DeInitAllModules( void ) +{ + // Eigene Module initialisieren + for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + { + SbModule* pModule = (SbModule*)pModules->Get( nMod ); + if( pModule->pImage ) + pModule->pImage->bInit = false; + } + // Alle Objekte ueberpruefen, ob es sich um ein Basic handelt + // Wenn ja, auch dort initialisieren + for ( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + { + SbxVariable* pVar = pObjs->Get( nObj ); + StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); + if( pBasic ) + pBasic->DeInitAllModules(); + } +} + +// Diese Implementation sucht erst innerhalb der Runtime-Library, dann +// nach einem Element innerhalb eines Moduls. Dieses Element kann eine +// Public-Variable oder ein Entrypoint sein. Wenn nicht gefunden, wird, +// falls nach einer Methode gesucht wird und ein Modul mit dem angege- +// benen Namen gefunden wurde, der Entrypoint "Main" gesucht. Wenn das +// auch nicht klappt, laeuft die traditionelle Suche ueber Objekte an. + +SbxVariable* StarBASIC::Find( const String& rName, SbxClassType t ) +{ + static String aMainStr( RTL_CONSTASCII_USTRINGPARAM("Main") ); + + SbxVariable* pRes = NULL; + SbModule* pNamed = NULL; + // "Extended" search in Runtime Lib + // aber nur, wenn SbiRuntime nicht das Flag gesetzt hat + if( !bNoRtl ) + { + if( t == SbxCLASS_DONTCARE || t == SbxCLASS_OBJECT ) + { + if( rName.EqualsIgnoreCaseAscii( RTLNAME ) ) + pRes = pRtl; + } + if( pRes ) + pRes->SetFlag( SBX_EXTFOUND ); + } + // Module durchsuchen + if( !pRes ) + for( USHORT i = 0; i < pModules->Count(); i++ ) + { + SbModule* p = (SbModule*) pModules->Get( i ); + if( p->IsVisible() ) + { + // Modul merken fuer Main()-Aufruf + // oder stimmt etwa der Name ueberein?!? + if( p->GetName().EqualsIgnoreCaseAscii( rName ) ) + { + if( t == SbxCLASS_OBJECT || t == SbxCLASS_DONTCARE ) + { + pRes = p; break; + } + pNamed = p; + } + // Sonst testen, ob das Element vorhanden ist + // GBLSEARCH-Flag rausnehmen (wg. Rekursion) + USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH; + p->ResetFlag( SBX_GBLSEARCH ); + pRes = p->Find( rName, t ); + p->SetFlag( nGblFlag ); + if( pRes ) + break; + } + } + if( !pRes && pNamed && ( t == SbxCLASS_METHOD || t == SbxCLASS_DONTCARE ) && + !pNamed->GetName().EqualsIgnoreCaseAscii( aMainStr ) ) + pRes = pNamed->Find( aMainStr, SbxCLASS_METHOD ); + if( !pRes ) + pRes = SbxObject::Find( rName, t ); + return pRes; +} + +BOOL StarBASIC::Call( const String& rName, SbxArray* pParam ) +{ + BOOL bRes = SbxObject::Call( rName, pParam ); + if( !bRes ) + { + SbxError eErr = SbxBase::GetError(); + SbxBase::ResetError(); + if( eErr != SbxERR_OK ) + RTError( (SbError)eErr, 0, 0, 0 ); + } + return bRes; +} + +void StarBASIC::Stop() { } + +BOOL StarBASIC::IsRunning() +{ + return BOOL( pINST != NULL ); +} + +/************************************************************************** +* +* Debugging und Fehlerbehandlung +* +**************************************************************************/ + +USHORT StarBASIC::BreakHdl() +{ + return (USHORT) ( aBreakHdl.IsSet() + ? aBreakHdl.Call( this ) : SbDEBUG_CONTINUE ); +} + +// AB: 29.3.96 +// Das Mapping zwischen alten und neuen Fehlercodes erfolgt, indem die Tabelle +// SFX_VB_ErrorTab[] durchsucht wird. Dies ist zwar nicht besonders performant, +// verbraucht aber viel weniger Speicher als entsprechende switch-Bloecke. +// Die Umrechnung von Fehlercodes muss nicht schnell sein, daher auch keine +// binaere Suche bei VB-Error -> SFX-Error. + +// Neue Fehler-Codes auf alte, Sbx-Kompatible zurueckmappen +USHORT StarBASIC::GetVBErrorCode( SbError nError ) +{ + USHORT nRet = 0; + + // Suchschleife + const SFX_VB_ErrorItem* pErrItem; + USHORT nIndex = 0; + do + { + pErrItem = SFX_VB_ErrorTab + nIndex; + if( pErrItem->nErrorSFX == nError ) + { + nRet = pErrItem->nErrorVB; + break; + } + nIndex++; + } + while( pErrItem->nErrorVB != 0xFFFF ); // bis End-Marke + return nRet; +} + +SbError StarBASIC::GetSfxFromVBError( USHORT nError ) +{ + SbError nRet = 0L; + + // Suchschleife + const SFX_VB_ErrorItem* pErrItem; + USHORT nIndex = 0; + do + { + pErrItem = SFX_VB_ErrorTab + nIndex; + if( pErrItem->nErrorVB == nError ) + { + nRet = pErrItem->nErrorSFX; + break; + } + else if( pErrItem->nErrorVB > nError ) + break; // kann nicht mehr gefunden werden + + nIndex++; + } + while( pErrItem->nErrorVB != 0xFFFF ); // bis End-Marke + return nRet; +} + +// Error- / Break-Daten setzen +void StarBASIC::SetErrorData +( SbError nCode, USHORT nLine, USHORT nCol1, USHORT nCol2 ) +{ + SbiGlobals& aGlobals = *GetSbData(); + aGlobals.nCode = nCode; + aGlobals.nLine = nLine; + aGlobals.nCol1 = nCol1; + aGlobals.nCol2 = nCol2; +} + +//---------------------------------------------------------------- +// Hilfsklasse zum Zugriff auf String SubResourcen einer Resource. +// Quelle: sfx2\source\doc\docfile.cxx (TLX) +struct BasicStringList_Impl : private Resource +{ + ResId aResId; + + BasicStringList_Impl( ResId& rErrIdP, USHORT nId) + : Resource( rErrIdP ),aResId(nId,*rErrIdP.GetResMgr()){} + ~BasicStringList_Impl() { FreeResource(); } + + String GetString(){ return String( aResId ); } + BOOL IsErrorTextAvailable( void ) + { return IsAvailableRes(aResId.SetRT(RSC_STRING)); } +}; +//---------------------------------------------------------------- + +// #60175 Flag, das bei Basic-Fehlern das Anziehen der SFX-Resourcen verhindert +static BOOL bStaticSuppressSfxResource = FALSE; + +void StarBASIC::MakeErrorText( SbError nId, const String& /*aMsg*/ ) +{ + SolarMutexGuard aSolarGuard; + + if( bStaticSuppressSfxResource ) + { + GetSbData()->aErrMsg = String( RTL_CONSTASCII_USTRINGPARAM("No resource: Error message not available") ); + return; + } + + USHORT nOldID = GetVBErrorCode( nId ); + + if( nOldID != 0 ) + { + String aStdMsg( RTL_CONSTASCII_USTRINGPARAM("error ") ); + aStdMsg += String::CreateFromInt32( nOldID); + aStdMsg += String( RTL_CONSTASCII_USTRINGPARAM(": no error message available!") ); + GetSbData()->aErrMsg = aStdMsg; + } + else + GetSbData()->aErrMsg = String::EmptyString(); +} + +BOOL StarBASIC::CError + ( SbError code, const String& rMsg, USHORT l, USHORT c1, USHORT c2 ) +{ + SolarMutexGuard aSolarGuard; + + // Compiler-Fehler waehrend der Laufzeit -> Programm anhalten + if( IsRunning() ) + { + Stop(); + } + + // Flag setzen, damit GlobalRunInit den Fehler mitbekommt + GetSbData()->bGlobalInitErr = TRUE; + + // Fehlertext basteln + MakeErrorText( code, rMsg ); + + // Umsetzung des Codes fuer String-Transport in SFX-Error + if( rMsg.Len() ) + code = (ULONG)*new StringErrorInfo( code, String(rMsg) ); + + SetErrorData( code, l, c1, c2 ); + GetSbData()->bCompiler = TRUE; + BOOL bRet; + if( GetSbData()->aErrHdl.IsSet() ) + bRet = (BOOL) GetSbData()->aErrHdl.Call( this ); + else + bRet = ErrorHdl(); + GetSbData()->bCompiler = FALSE; // Only TRUE for Error-Handler + return bRet; +} + +BOOL StarBASIC::RTError + ( SbError code, USHORT l, USHORT c1, USHORT c2 ) +{ + return RTError( code, String(), l, c1, c2 ); +} + +BOOL StarBASIC::RTError( SbError code, const String& rMsg, USHORT l, USHORT c1, USHORT c2 ) +{ + SolarMutexGuard aSolarGuard; + + SbError c = code; + if( (c & ERRCODE_CLASS_MASK) == ERRCODE_CLASS_COMPILER ) + c = 0; + MakeErrorText( c, rMsg ); + + // Umsetzung des Codes fuer String-Transport in SFX-Error + if( rMsg.Len() ) + code = (ULONG)*new StringErrorInfo( code, String(rMsg) ); + + SetErrorData( code, l, c1, c2 ); + if( GetSbData()->aErrHdl.IsSet() ) + return (BOOL) GetSbData()->aErrHdl.Call( this ); + else + return ErrorHdl(); +} + +void StarBASIC::Error( SbError n ) +{ + Error( n, String() ); +} + +void StarBASIC::Error( SbError /*n*/, const String& /*rMsg*/ ) { } + +void StarBASIC::FatalError( SbError /*n*/ ) { } + +BOOL StarBASIC::ErrorHdl() +{ + return (BOOL) ( aErrorHdl.IsSet() + ? aErrorHdl.Call( this ) : FALSE ); +} + +/************************************************************************** +* +* Saving and Loading +* +**************************************************************************/ + +BOOL StarBASIC::LoadData( SvStream& r, USHORT nVer ) +{ + if( !SbxObject::LoadData( r, nVer ) ) + return FALSE; + + // #95459 Delete dialogs, otherwise endless recursion + // in SbxVarable::GetType() if dialogs are accessed + USHORT nObjCount = pObjs->Count(); + SbxVariable** ppDeleteTab = new SbxVariable*[ nObjCount ]; + USHORT nObj; + + for( nObj = 0 ; nObj < nObjCount ; nObj++ ) + { + SbxVariable* pVar = pObjs->Get( nObj ); + StarBASIC* pBasic = PTR_CAST( StarBASIC, pVar ); + ppDeleteTab[nObj] = pBasic ? NULL : pVar; + } + for( nObj = 0 ; nObj < nObjCount ; nObj++ ) + { + SbxVariable* pVar = ppDeleteTab[nObj]; + if( pVar ) + pObjs->Remove( pVar ); + } + delete[] ppDeleteTab; + + UINT16 nMod; + pModules->Clear(); + r >> nMod; + for( USHORT i = 0; i < nMod; i++ ) + { + SbModule* pMod = (SbModule*) SbxBase::Load( r ); + if( !pMod ) + return FALSE; + else if( pMod->ISA(SbJScriptModule) ) + { + // Ref zuweisen, damit pMod deleted wird + SbModuleRef xRef = pMod; + } + else + { + pMod->SetParent( this ); + pModules->Put( pMod, i ); + } + } + // HACK fuer SFX-Mist! + SbxVariable* p = Find( String( RTL_CONSTASCII_USTRINGPARAM("FALSE") ), SbxCLASS_PROPERTY ); + if( p ) + Remove( p ); + p = Find( String( RTL_CONSTASCII_USTRINGPARAM("TRUE") ), SbxCLASS_PROPERTY ); + if( p ) + Remove( p ); + // Ende des Hacks! + // Suche ueber StarBASIC ist immer global + DBG_ASSERT( IsSet( SBX_GBLSEARCH ), "Basic ohne GBLSEARCH geladen" ); + SetFlag( SBX_GBLSEARCH ); + return TRUE; +} + +//======================================================================== +// #118116 Implementation Collection object + +TYPEINIT1(BasicCollection,SbxObject) + +static const char pCountStr[] = "Count"; +static const char pAddStr[] = "Add"; +static const char pItemStr[] = "Item"; +static const char pRemoveStr[] = "Remove"; +static USHORT nCountHash = 0, nAddHash, nItemHash, nRemoveHash; + +BasicCollection::BasicCollection( const XubString& rClass ) + : SbxObject( rClass ) +{ + if( !nCountHash ) + { + nCountHash = MakeHashCode( String::CreateFromAscii( pCountStr ) ); + nAddHash = MakeHashCode( String::CreateFromAscii( pAddStr ) ); + nItemHash = MakeHashCode( String::CreateFromAscii( pItemStr ) ); + nRemoveHash = MakeHashCode( String::CreateFromAscii( pRemoveStr ) ); + } + Initialize(); +} + +BasicCollection::~BasicCollection() +{} + +void BasicCollection::Clear() +{ + SbxObject::Clear(); + Initialize(); +} + +void BasicCollection::Initialize() +{ + xItemArray = new SbxArray(); + SetType( SbxOBJECT ); + SetFlag( SBX_FIXED ); + ResetFlag( SBX_WRITE ); + SbxVariable* p; + p = Make( String::CreateFromAscii( pCountStr ), SbxCLASS_PROPERTY, SbxINTEGER ); + p->ResetFlag( SBX_WRITE ); + p->SetFlag( SBX_DONTSTORE ); + p = Make( String::CreateFromAscii( pAddStr ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p = Make( String::CreateFromAscii( pItemStr ), SbxCLASS_METHOD, SbxVARIANT ); + p->SetFlag( SBX_DONTSTORE ); + p = Make( String::CreateFromAscii( pRemoveStr ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); +} + +SbxVariable* BasicCollection::Find( const XubString& rName, SbxClassType t ) +{ + SbxVariable* pFind = SbxObject::Find( rName, t ); + return pFind; +} + +void BasicCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1, + const SfxHint& rHint, const TypeId& rId2 ) +{ + const SbxHint* p = PTR_CAST(SbxHint,&rHint); + if( p ) + { + ULONG nId = p->GetId(); + BOOL bRead = BOOL( nId == SBX_HINT_DATAWANTED ); + BOOL bWrite = BOOL( nId == SBX_HINT_DATACHANGED ); + SbxVariable* pVar = p->GetVar(); + SbxArray* pArg = pVar->GetParameters(); + if( bRead || bWrite ) + { + XubString aVarName( pVar->GetName() ); + if( pVar->GetHashCode() == nCountHash + && aVarName.EqualsIgnoreCaseAscii( pCountStr ) ) + pVar->PutLong( xItemArray->Count32() ); + else if( pVar->GetHashCode() == nAddHash + && aVarName.EqualsIgnoreCaseAscii( pAddStr ) ) + CollAdd( pArg ); + else if( pVar->GetHashCode() == nItemHash + && aVarName.EqualsIgnoreCaseAscii( pItemStr ) ) + CollItem( pArg ); + else if( pVar->GetHashCode() == nRemoveHash + && aVarName.EqualsIgnoreCaseAscii( pRemoveStr ) ) + CollRemove( pArg ); + else + SbxObject::SFX_NOTIFY( rCst, rId1, rHint, rId2 ); + return; + } + } + SbxObject::SFX_NOTIFY( rCst, rId1, rHint, rId2 ); +} + +INT32 BasicCollection::implGetIndex( SbxVariable* pIndexVar ) +{ + INT32 nIndex = -1; + if( pIndexVar->GetType() == SbxSTRING ) + nIndex = implGetIndexForName( pIndexVar->GetString() ); + else + nIndex = pIndexVar->GetLong() - 1; + return nIndex; +} + +INT32 BasicCollection::implGetIndexForName( const String& rName ) +{ + INT32 nIndex = -1; + INT32 nCount = xItemArray->Count32(); + INT32 nNameHash = MakeHashCode( rName ); + for( INT32 i = 0 ; i < nCount ; i++ ) + { + SbxVariable* pVar = xItemArray->Get32( i ); + if( pVar->GetHashCode() == nNameHash && + pVar->GetName().EqualsIgnoreCaseAscii( rName ) ) + { + nIndex = i; + break; + } + } + return nIndex; +} + +void BasicCollection::CollAdd( SbxArray* pPar_ ) +{ + USHORT nCount = pPar_->Count(); + if( nCount < 2 || nCount > 5 ) + { + SetError( SbxERR_WRONG_ARGS ); + return; + } + + SbxVariable* pItem = pPar_->Get(1); + if( pItem ) + { + int nNextIndex; + if( nCount < 4 ) + { + nNextIndex = xItemArray->Count(); + } + else + { + SbxVariable* pBefore = pPar_->Get(3); + if( nCount == 5 ) + { + if( !pBefore->IsErr() ) + { + SetError( SbERR_BAD_ARGUMENT ); + return; + } + SbxVariable* pAfter = pPar_->Get(4); + INT32 nAfterIndex = implGetIndex( pAfter ); + if( nAfterIndex == -1 ) + { + SetError( SbERR_BAD_ARGUMENT ); + return; + } + nNextIndex = nAfterIndex + 1; + } + else + { + INT32 nBeforeIndex = implGetIndex( pBefore ); + if( nBeforeIndex == -1 ) + { + SetError( SbERR_BAD_ARGUMENT ); + return; + } + nNextIndex = nBeforeIndex; + } + } + + SbxVariableRef pNewItem = new SbxVariable( *pItem ); + if( nCount >= 3 ) + { + SbxVariable* pKey = pPar_->Get(2); + if( !pKey->IsErr() ) + { + if( pKey->GetType() != SbxSTRING ) + { + SetError( SbERR_BAD_ARGUMENT ); + return; + } + String aKey = pKey->GetString(); + if( implGetIndexForName( aKey ) != -1 ) + { + SetError( SbERR_BAD_ARGUMENT ); + return; + } + pNewItem->SetName( aKey ); + } + } + pNewItem->SetFlag( SBX_READWRITE ); + xItemArray->Insert32( pNewItem, nNextIndex ); + } + else + { + SetError( SbERR_BAD_ARGUMENT ); + return; + } +} + +void BasicCollection::CollItem( SbxArray* pPar_ ) +{ + if( pPar_->Count() != 2 ) + { + SetError( SbxERR_WRONG_ARGS ); + return; + } + SbxVariable* pRes = NULL; + SbxVariable* p = pPar_->Get( 1 ); + INT32 nIndex = implGetIndex( p ); + if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) + pRes = xItemArray->Get32( nIndex ); + if( !pRes ) + SetError( SbxERR_BAD_INDEX ); + *(pPar_->Get(0)) = *pRes; +} + +void BasicCollection::CollRemove( SbxArray* pPar_ ) +{ + if( pPar_ == NULL || pPar_->Count() != 2 ) + { + SetError( SbxERR_WRONG_ARGS ); + return; + } + + SbxVariable* p = pPar_->Get( 1 ); + INT32 nIndex = implGetIndex( p ); + if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) + xItemArray->Remove32( nIndex ); + else + SetError( SbxERR_BAD_INDEX ); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/classes/sbintern.cxx b/bf_basic/source/classes/sbintern.cxx new file mode 100644 index 00000000000..795643de248 --- /dev/null +++ b/bf_basic/source/classes/sbintern.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sbintern.hxx" +#include "sbunoobj.hxx" +#include "token.hxx" // Tokenizer +#include "codegen.hxx" // Code-Generator + +namespace binfilter { + +SV_IMPL_PTRARR(SbErrorStack, SbErrorStackEntry*) + +SbiGlobals* GetSbData() +{ + DBG_TESTSOLARMUTEX(); + static SbiGlobals* s_pGlobals = new SbiGlobals; + return s_pGlobals; +} + +SbiGlobals::SbiGlobals() +{ + pInst = NULL; + pMod = NULL; + pSbFac= NULL; + pUnoFac = NULL; + pTypeFac = NULL; + pOLEFac = NULL; + pCompMod = NULL; // JSM + nInst = 0; + nCode = 0; + nLine = 0; + nCol1 = nCol2 = 0; + bCompiler = FALSE; + bGlobalInitErr = FALSE; + bRunInit = FALSE; + eLanguageMode = SB_LANG_BASIC; + pErrStack = NULL; + pTransliterationWrapper = NULL; + bBlockCompilerError = FALSE; + pAppBasMgr = NULL; +} + +SbiGlobals::~SbiGlobals() +{ + delete pErrStack; + delete pSbFac; + delete pUnoFac; + delete pTransliterationWrapper; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/classes/sbunoobj.cxx b/bf_basic/source/classes/sbunoobj.cxx new file mode 100644 index 00000000000..858569db50a --- /dev/null +++ b/bf_basic/source/classes/sbunoobj.cxx @@ -0,0 +1,2537 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::reflection; +using namespace com::sun::star::beans; +using namespace com::sun::star::script; +using namespace com::sun::star::container; +using namespace com::sun::star::bridge; +using namespace cppu; + +using ::rtl::OUString; + + +#include "sbstar.hxx" +#include "sberrors.hxx" +#include "sbunoobj.hxx" +#include "sbjsmod.hxx" +#include "sbintern.hxx" + +#include + +namespace binfilter { + +TYPEINIT1(SbUnoMethod,SbxMethod) +TYPEINIT1(SbUnoProperty,SbxProperty) +TYPEINIT1(SbUnoObject,SbxObject) +TYPEINIT1(SbUnoClass,SbxObject) + +typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper; + +// Identifier fuer die dbg_-Properies als Strings anlegen +static String ID_DBG_SUPPORTEDINTERFACES( RTL_CONSTASCII_USTRINGPARAM("Dbg_SupportedInterfaces") ); +static String ID_DBG_PROPERTIES( RTL_CONSTASCII_USTRINGPARAM("Dbg_Properties") ); +static String ID_DBG_METHODS( RTL_CONSTASCII_USTRINGPARAM("Dbg_Methods") ); + +static String aIllegalArgumentExceptionName + ( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.IllegalArgumentException" ) ); +static OUString aSeqLevelStr( RTL_CONSTASCII_USTRINGPARAM("[]") ); + +Reference< XComponentContext > getComponentContext_Impl( void ) +{ + static Reference< XComponentContext > xContext; + + // Haben wir schon CoreReflection, sonst besorgen + if( !xContext.is() ) + { + Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + Reference< XPropertySet > xProps( xFactory, UNO_QUERY ); + OSL_ASSERT( xProps.is() ); + if (xProps.is()) + { + xProps->getPropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext; + OSL_ASSERT( xContext.is() ); + } + } + return xContext; +} + +// CoreReflection statisch speichern +Reference< XIdlReflection > getCoreReflection_Impl( void ) +{ + static Reference< XIdlReflection > xCoreReflection; + + // Haben wir schon CoreReflection, sonst besorgen + if( !xCoreReflection.is() ) + { + Reference< XComponentContext > xContext = getComponentContext_Impl(); + if( xContext.is() ) + { + xContext->getValueByName( + OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection") ) ) + >>= xCoreReflection; + OSL_ENSURE( xCoreReflection.is(), "### CoreReflection singleton not accessable!?" ); + } + if( !xCoreReflection.is() ) + { + throw DeploymentException( + OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection singleton not accessable") ), + Reference< XInterface >() ); + } + } + return xCoreReflection; +} + +// CoreReflection statisch speichern +Reference< XHierarchicalNameAccess > getCoreReflection_HierarchicalNameAccess_Impl( void ) +{ + static Reference< XHierarchicalNameAccess > xCoreReflection_HierarchicalNameAccess; + + if( !xCoreReflection_HierarchicalNameAccess.is() ) + { + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( xCoreReflection.is() ) + { + xCoreReflection_HierarchicalNameAccess = + Reference< XHierarchicalNameAccess >( xCoreReflection, UNO_QUERY ); + } + } + return xCoreReflection_HierarchicalNameAccess; +} + +// Hold TypeProvider statically +Reference< XHierarchicalNameAccess > getTypeProvider_Impl( void ) +{ + static Reference< XHierarchicalNameAccess > xAccess; + + // Haben wir schon CoreReflection, sonst besorgen + if( !xAccess.is() ) + { + Reference< XComponentContext > xContext = getComponentContext_Impl(); + if( xContext.is() ) + { + xContext->getValueByName( + OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theTypeDescriptionManager") ) ) + >>= xAccess; + OSL_ENSURE( xAccess.is(), "### TypeDescriptionManager singleton not accessable!?" ); + } + if( !xAccess.is() ) + { + throw DeploymentException( + OUString( RTL_CONSTASCII_USTRINGPARAM + ("/singletons/com.sun.star.reflection.theTypeDescriptionManager singleton not accessable") ), + Reference< XInterface >() ); + } + } + return xAccess; +} + +// #111851 factory function to create an OLE object +SbUnoObject* createOLEObject_Impl( const String& aType ) +{ + static Reference< XMultiServiceFactory > xOLEFactory; + static bool bNeedsInit = true; + + if( bNeedsInit ) + { + bNeedsInit = false; + + Reference< XComponentContext > xContext = getComponentContext_Impl(); + if( xContext.is() ) + { + Reference xSMgr = xContext->getServiceManager(); + xOLEFactory = Reference( + xSMgr->createInstanceWithContext( + OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.OleObjectFactory")), + xContext ), UNO_QUERY ); + } + } + + SbUnoObject* pUnoObj = NULL; + if( xOLEFactory.is() ) + { + Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aType ); + if( xOLEObject.is() ) + { + Any aAny; + aAny <<= xOLEObject; + pUnoObj = new SbUnoObject( aType, aAny ); + } + } + return pUnoObj; +} + + +String implGetExceptionMsg( Exception& e, const String& aExceptionType_ ); + +// #105565 Special Object to wrap a strongly typed Uno Any +TYPEINIT1(SbUnoAnyObject,SbxObject) + +// TODO: Spaeter auslagern +Reference TypeToIdlClass( const Type& rType ) +{ + // void als Default-Klasse eintragen + Reference xRetClass; + typelib_TypeDescription * pTD = 0; + rType.getDescription( &pTD ); + + if( pTD ) + { + OUString sOWName( pTD->pTypeName ); + Reference< XIdlReflection > xRefl = getCoreReflection_Impl(); + xRetClass = xRefl->forName( sOWName ); + } + return xRetClass; +} + +// Fehlermeldungs-Message bei Exception zusammenbauen +String implGetExceptionMsg( Exception& e, const String& aExceptionType_ ) +{ + String aExceptionType = aExceptionType_; + if( aExceptionType.Len() == 0 ) + aExceptionType = String( RTL_CONSTASCII_USTRINGPARAM("Unknown" ) ); + + String aTypeLine( RTL_CONSTASCII_USTRINGPARAM("\nType: " ) ); + aTypeLine += aExceptionType; + + String aMessageLine( RTL_CONSTASCII_USTRINGPARAM("\nMessage: " ) ); + aMessageLine += String( e.Message ); + + String aMsg = aTypeLine; + aMsg += aMessageLine; + return aMsg; +} + +// Exception type unknown +String implGetExceptionMsg( Exception& e ) +{ + String aMsg = implGetExceptionMsg( e, String() ); + return aMsg; +} + +// Error-Message fuer WrappedTargetExceptions +String implGetWrappedMsg( WrappedTargetException& e ) +{ + String aMsg; + Any aWrappedAny = e.TargetException; + Type aExceptionType = aWrappedAny.getValueType(); + + // Really an Exception? + if( aExceptionType.getTypeClass() == TypeClass_EXCEPTION ) + { + RuntimeException& e_ = *( (RuntimeException*)aWrappedAny.getValue() ); + aMsg = implGetExceptionMsg( e_, String( aExceptionType.getTypeName() ) ); + } + // Otherwise use WrappedTargetException itself + else + { + aMsg = implGetExceptionMsg( e ); + } + + return aMsg; +} + +void implHandleBasicErrorException( BasicErrorException& e ) +{ + SbError nError = StarBASIC::GetSfxFromVBError( (USHORT)e.ErrorCode ); + StarBASIC::Error( nError, e.ErrorMessageArgument ); +} + +void implHandleWrappedTargetException( WrappedTargetException& e ) +{ + SbError nError; + String aMessage; + Any aWrappedAny = e.TargetException; + if ( aWrappedAny.getValueType() == ::getCppuType( (BasicErrorException*)NULL ) ) + { + BasicErrorException& be = *( (BasicErrorException*)aWrappedAny.getValue() ); + nError = StarBASIC::GetSfxFromVBError( (USHORT)be.ErrorCode ); + aMessage = be.ErrorMessageArgument; + } + else + { + nError = ERRCODE_BASIC_EXCEPTION; + aMessage = implGetWrappedMsg( e ); + } + StarBASIC::Error( nError, aMessage ); +} + +// Von Uno nach Sbx wandeln +SbxDataType unoToSbxType( TypeClass eType ) +{ + SbxDataType eRetType = SbxVOID; + + switch( eType ) + { + case TypeClass_INTERFACE: + case TypeClass_TYPE: + case TypeClass_STRUCT: + case TypeClass_EXCEPTION: eRetType = SbxOBJECT; break; + + case TypeClass_ENUM: eRetType = SbxLONG; break; + case TypeClass_SEQUENCE: + eRetType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); + break; + + case TypeClass_ANY: eRetType = SbxVARIANT; break; + case TypeClass_BOOLEAN: eRetType = SbxBOOL; break; + case TypeClass_CHAR: eRetType = SbxCHAR; break; + case TypeClass_STRING: eRetType = SbxSTRING; break; + case TypeClass_FLOAT: eRetType = SbxSINGLE; break; + case TypeClass_DOUBLE: eRetType = SbxDOUBLE; break; + case TypeClass_BYTE: eRetType = SbxINTEGER; break; + case TypeClass_SHORT: eRetType = SbxINTEGER; break; + case TypeClass_LONG: eRetType = SbxLONG; break; + case TypeClass_HYPER: eRetType = SbxSALINT64; break; + case TypeClass_UNSIGNED_SHORT: eRetType = SbxUSHORT; break; + case TypeClass_UNSIGNED_LONG: eRetType = SbxULONG; break; + case TypeClass_UNSIGNED_HYPER: eRetType = SbxSALUINT64;break; + default: break; + } + return eRetType; +} + +SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass ) +{ + SbxDataType eRetType = SbxVOID; + if( xIdlClass.is() ) + { + TypeClass eType = xIdlClass->getTypeClass(); + eRetType = unoToSbxType( eType ); + } + return eRetType; +} +void unoToSbxValue( SbxVariable* pVar, const Any& aValue ); +static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int32 >& indices, Sequence< sal_Int32 >& sizes, const Any& aValue, sal_Int32& dimension, sal_Bool bIsZeroIndex ) +{ + Type aType = aValue.getValueType(); + TypeClass eTypeClass = aType.getTypeClass(); + + sal_Int32 dimCopy = dimension; + + if ( eTypeClass == TypeClass_SEQUENCE ) + { + Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( aType ); + Reference< XIdlArray > xIdlArray = xIdlTargetClass->getArray(); + sal_Int32 nLen = xIdlArray->getLen( aValue ); + for ( sal_Int32 index = 0; index < nLen; ++index ) + { + Any aElementAny = xIdlArray->get( aValue, (UINT32)index ); + // This detects the dimension were currently processing + if ( dimCopy == dimension ) + { + ++dimCopy; + if ( sizes.getLength() < dimCopy ) + { + sizes.realloc( sizes.getLength() + 1 ); + sizes[ sizes.getLength() - 1 ] = nLen; + indices.realloc( indices.getLength() + 1 ); + } + } + + if ( bIsZeroIndex ) + indices[ dimCopy - 1 ] = index; + else + indices[ dimCopy - 1] = index + 1; + + implSequenceToMultiDimArray( pArray, indices, sizes, aElementAny, dimCopy, bIsZeroIndex ); + } + + } + else + { + if ( indices.getLength() < 1 ) + { + // Should never ever get here ( indices.getLength() + // should equal number of dimensions in the array ) + // And that should at least be 1 ! + // #QUESTION is there a better error? + StarBASIC::Error( SbERR_INVALID_OBJECT ); + return; + } + + if ( !pArray ) + { + SbxDataType eSbxElementType = unoToSbxType( aValue.getValueTypeClass() ); + pArray = new SbxDimArray( eSbxElementType ); + sal_Int32 nIndexLen = indices.getLength(); + + // Dimension the array + for ( sal_Int32 index = 0; index < nIndexLen; ++index ) + { + if ( bIsZeroIndex ) + pArray->unoAddDim32( 0, sizes[ index ] - 1); + else + pArray->unoAddDim32( 1, sizes[ index ] ); + + } + } + + if ( pArray ) + { + SbxDataType eSbxElementType = unoToSbxType( aValue.getValueTypeClass() ); + SbxVariableRef xVar = new SbxVariable( eSbxElementType ); + unoToSbxValue( (SbxVariable*)xVar, aValue ); + + sal_Int32* pIndices = indices.getArray(); + pArray->Put32( (SbxVariable*)xVar, pIndices ); + + } + } +} + +void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) +{ + Type aType = aValue.getValueType(); + TypeClass eTypeClass = aType.getTypeClass(); + switch( eTypeClass ) + { + case TypeClass_TYPE: + { + // Map Type to IdlClass + Type aType_; + aValue >>= aType_; + Reference xClass = TypeToIdlClass( aType_ ); + Any aClassAny; + aClassAny <<= xClass; + + // SbUnoObject instanzieren + String aName; + SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aClassAny ); + SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject; + + // #51475 Wenn das Objekt ungueltig ist null liefern + if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID ) + { + pVar->PutObject( NULL ); + } + else + { + pVar->PutObject( xWrapper ); + } + } + break; + // Interfaces und Structs muessen in ein SbUnoObject gewrappt werden + case TypeClass_INTERFACE: + case TypeClass_STRUCT: + case TypeClass_EXCEPTION: + { + if( eTypeClass == TypeClass_STRUCT ) + { + ArrayWrapper aWrap; + if ( (aValue >>= aWrap) ) + { + SbxDimArray* pArray = NULL; + Sequence< sal_Int32 > indices; + Sequence< sal_Int32 > sizes; + sal_Int32 dimension = 0; + implSequenceToMultiDimArray( pArray, indices, sizes, aWrap.Array, dimension, aWrap.IsZeroIndex ); + if ( pArray ) + { + SbxDimArrayRef xArray = pArray; + USHORT nFlags = pVar->GetFlags(); + pVar->ResetFlag( SBX_FIXED ); + pVar->PutObject( (SbxDimArray*)xArray ); + pVar->SetFlags( nFlags ); + } + else + pVar->PutEmpty(); + break; + } + } + // SbUnoObject instanzieren + String aName; + SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aValue ); + SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject; + + // #51475 Wenn das Objekt ungueltig ist null liefern + if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID ) + { + pVar->PutObject( NULL ); + } + else + { + pVar->PutObject( xWrapper ); + } + } + break; + + /* folgende Typen lassen wir erstmal weg + case TypeClass_SERVICE: break; + case TypeClass_CLASS: break; + case TypeClass_TYPEDEF: break; + case TypeClass_UNION: break; + case TypeClass_ENUM: break; + case TypeClass_ARRAY: break; + */ + + case TypeClass_ENUM: + { + sal_Int32 nEnum = 0; + enum2int( nEnum, aValue ); + pVar->PutLong( nEnum ); + } + break; + + case TypeClass_SEQUENCE: + { + Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( aType ); + Reference< XIdlArray > xIdlArray = xIdlTargetClass->getArray(); + sal_Int32 i, nLen = xIdlArray->getLen( aValue ); + + typelib_TypeDescription * pTD = 0; + aType.getDescription( &pTD ); + OSL_ASSERT( pTD && pTD->eTypeClass == typelib_TypeClass_SEQUENCE ); + Type aElementType( ((typelib_IndirectTypeDescription *)pTD)->pType ); + ::typelib_typedescription_release( pTD ); + + // In Basic Array anlegen + SbxDimArrayRef xArray; + SbxDataType eSbxElementType = unoToSbxType( aElementType.getTypeClass() ); + xArray = new SbxDimArray( eSbxElementType ); + if( nLen > 0 ) + { + xArray->unoAddDim32( 0, nLen - 1 ); + + // Elemente als Variablen eintragen + for( i = 0 ; i < nLen ; i++ ) + { + // Elemente wandeln + Any aElementAny = xIdlArray->get( aValue, (UINT32)i ); + SbxVariableRef xVar = new SbxVariable( eSbxElementType ); + unoToSbxValue( (SbxVariable*)xVar, aElementAny ); + + // Ins Array braten + xArray->Put32( (SbxVariable*)xVar, &i ); + } + } + else + { + xArray->unoAddDim( 0, -1 ); + } + + // Array zurueckliefern + USHORT nFlags = pVar->GetFlags(); + pVar->ResetFlag( SBX_FIXED ); + pVar->PutObject( (SbxDimArray*)xArray ); + pVar->SetFlags( nFlags ); + + } + break; + + case TypeClass_BOOLEAN: pVar->PutBool( *(sal_Bool*)aValue.getValue() ); break; + case TypeClass_CHAR: + { + pVar->PutChar( *(sal_Unicode*)aValue.getValue() ); + break; + } + case TypeClass_STRING: { OUString val; aValue >>= val; pVar->PutString( String( val ) ); } break; + case TypeClass_FLOAT: { float val = 0; aValue >>= val; pVar->PutSingle( val ); } break; + case TypeClass_DOUBLE: { double val = 0; aValue >>= val; pVar->PutDouble( val ); } break; + case TypeClass_BYTE: { sal_Int8 val = 0; aValue >>= val; pVar->PutInteger( val ); } break; + case TypeClass_SHORT: { sal_Int16 val = 0; aValue >>= val; pVar->PutInteger( val ); } break; + case TypeClass_LONG: { sal_Int32 val = 0; aValue >>= val; pVar->PutLong( val ); } break; + case TypeClass_HYPER: { sal_Int64 val = 0; aValue >>= val; pVar->PutInt64( val ); } break; + case TypeClass_UNSIGNED_SHORT: { sal_uInt16 val = 0; aValue >>= val; pVar->PutUShort( val ); } break; + case TypeClass_UNSIGNED_LONG: { sal_uInt32 val = 0; aValue >>= val; pVar->PutULong( val ); } break; + case TypeClass_UNSIGNED_HYPER: { sal_uInt64 val = 0; aValue >>= val; pVar->PutUInt64( val ); } break; + default: pVar->PutEmpty(); break; + } +} + +// Reflection fuer Sbx-Typen liefern +Type getUnoTypeForSbxBaseType( SbxDataType eType ) +{ + Type aRetType = getCppuVoidType(); + switch( eType ) + { + case SbxNULL: aRetType = ::getCppuType( (const Reference< XInterface > *)0 ); break; + case SbxINTEGER: aRetType = ::getCppuType( (sal_Int16*)0 ); break; + case SbxLONG: aRetType = ::getCppuType( (sal_Int32*)0 ); break; + case SbxSINGLE: aRetType = ::getCppuType( (float*)0 ); break; + case SbxDOUBLE: aRetType = ::getCppuType( (double*)0 ); break; + case SbxCURRENCY: aRetType = ::getCppuType( (oleautomation::Currency*)0 ); break; + case SbxDECIMAL: aRetType = ::getCppuType( (oleautomation::Decimal*)0 ); break; + case SbxDATE: { + aRetType = ::getCppuType( (oleautomation::Date*)0 ); + } + break; + case SbxSTRING: aRetType = ::getCppuType( (OUString*)0 ); break; + case SbxBOOL: aRetType = ::getCppuType( (sal_Bool*)0 ); break; + case SbxVARIANT: aRetType = ::getCppuType( (Any*)0 ); break; + case SbxCHAR: aRetType = ::getCppuType( (sal_Unicode*)0 ); break; + case SbxBYTE: aRetType = ::getCppuType( (sal_Int16*)0 ); break; + case SbxUSHORT: aRetType = ::getCppuType( (sal_uInt16*)0 ); break; + case SbxULONG: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; + + // Maschinenabhaengige zur Sicherheit auf Hyper abbilden + case SbxINT: aRetType = ::getCppuType( (sal_Int32*)0 ); break; + case SbxUINT: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; + default: break; + } + return aRetType; +} + +// Konvertierung von Sbx nach Uno ohne bekannte Zielklasse fuer TypeClass_ANY +Type getUnoTypeForSbxValue( SbxValue* pVal ) +{ + Type aRetType = getCppuVoidType(); + if( !pVal ) + return aRetType; + + // SbxType nach Uno wandeln + SbxDataType eBaseType = pVal->SbxValue::GetType(); + if( eBaseType == SbxOBJECT ) + { + SbxBaseRef xObj = (SbxBase*)pVal->GetObject(); + if( !xObj ) + { + aRetType = getCppuType( static_cast *>(0) ); + return aRetType; + } + + if( xObj->ISA(SbxDimArray) ) + { + SbxBase* pObj = (SbxBase*)xObj; + SbxDimArray* pArray = (SbxDimArray*)pObj; + + short nDims = pArray->GetDims(); + Type aElementType = getUnoTypeForSbxBaseType( (SbxDataType)(pArray->GetType() & 0xfff) ); + TypeClass eElementTypeClass = aElementType.getTypeClass(); + + // Normal case: One dimensional array + sal_Int32 nLower, nUpper; + if( nDims == 1 && pArray->GetDim32( 1, nLower, nUpper ) ) + { + if( eElementTypeClass == TypeClass_VOID || eElementTypeClass == TypeClass_ANY ) + { + // Wenn alle Elemente des Arrays vom gleichen Typ sind, wird + // der genommen, sonst wird das ganze als Any-Sequence betrachtet + sal_Bool bNeedsInit = sal_True; + + INT32 nSize = nUpper - nLower + 1; + INT32 nIdx = nLower; + for( INT32 i = 0 ; i < nSize ; i++,nIdx++ ) + { + SbxVariableRef xVar = pArray->Get32( &nIdx ); + Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar ); + if( bNeedsInit ) + { + if( aType.getTypeClass() == TypeClass_VOID ) + { + // #88522 + // if only first element is void: different types -> []any + // if all elements are void: []void is not allowed -> []any + aElementType = getCppuType( (Any*)0 ); + break; + } + aElementType = aType; + bNeedsInit = sal_False; + } + else if( aElementType != aType ) + { + // Verschiedene Typen -> AnySequence + aElementType = getCppuType( (Any*)0 ); + break; + } + } + } + + OUString aSeqTypeName( aSeqLevelStr ); + aSeqTypeName += aElementType.getTypeName(); + aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName ); + } + // #i33795 Map also multi dimensional arrays to corresponding sequences + else if( nDims > 1 ) + { + if( eElementTypeClass == TypeClass_VOID || eElementTypeClass == TypeClass_ANY ) + { + // For this check the array's dim structure does not matter + UINT32 nFlatArraySize = pArray->Count32(); + + sal_Bool bNeedsInit = sal_True; + for( UINT32 i = 0 ; i < nFlatArraySize ; i++ ) + { + SbxVariableRef xVar = pArray->SbxArray::Get32( i ); + Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar ); + if( bNeedsInit ) + { + if( aType.getTypeClass() == TypeClass_VOID ) + { + // if only first element is void: different types -> []any + // if all elements are void: []void is not allowed -> []any + aElementType = getCppuType( (Any*)0 ); + break; + } + aElementType = aType; + bNeedsInit = sal_False; + } + else if( aElementType != aType ) + { + // Verschiedene Typen -> AnySequence + aElementType = getCppuType( (Any*)0 ); + break; + } + } + } + + OUString aSeqTypeName; + for( short iDim = 0 ; iDim < nDims ; iDim++ ) + aSeqTypeName += aSeqLevelStr; + aSeqTypeName += aElementType.getTypeName(); + aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName ); + } + } + // Kein Array, sondern... + else if( xObj->ISA(SbUnoObject) ) + { + aRetType = ((SbUnoObject*)(SbxBase*)xObj)->getUnoAny().getValueType(); + } + // SbUnoAnyObject? + else if( xObj->ISA(SbUnoAnyObject) ) + { + aRetType = ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue().getValueType(); + } + // Sonst ist es ein Nicht-Uno-Basic-Objekt -> default==void liefern + } + // Kein Objekt, Basistyp konvertieren + else + { + aRetType = getUnoTypeForSbxBaseType( eBaseType ); + } + return aRetType; +} + +// Deklaration Konvertierung von Sbx nach Uno mit bekannter Zielklasse +Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty = NULL ); + +// Konvertierung von Sbx nach Uno ohne bekannte Zielklasse fuer TypeClass_ANY +Any sbxToUnoValueImpl( SbxVariable* pVar, bool bBlockConversionToSmallestType = false ) +{ + SbxDataType eBaseType = pVar->SbxValue::GetType(); + if( eBaseType == SbxOBJECT ) + { + SbxBaseRef xObj = (SbxBase*)pVar->GetObject(); + if( xObj.Is() && xObj->ISA(SbUnoAnyObject) ) + return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue(); + } + + Type aType = getUnoTypeForSbxValue( pVar ); + TypeClass eType = aType.getTypeClass(); + + if( !bBlockConversionToSmallestType ) + { + // #79615 Choose "smallest" represention for int values + // because up cast is allowed, downcast not + switch( eType ) + { + case TypeClass_FLOAT: + case TypeClass_DOUBLE: + { + double d = pVar->GetDouble(); + if( d == floor( d ) ) + { + if( d >= -128 && d <= 127 ) + aType = ::getCppuType( (sal_Int8*)0 ); + else if( d >= SbxMININT && d <= SbxMAXINT ) + aType = ::getCppuType( (sal_Int16*)0 ); + else if( d >= -SbxMAXLNG && d <= SbxMAXLNG ) + aType = ::getCppuType( (sal_Int32*)0 ); + } + break; + } + case TypeClass_SHORT: + { + sal_Int16 n = pVar->GetInteger(); + if( n >= -128 && n <= 127 ) + aType = ::getCppuType( (sal_Int8*)0 ); + break; + } + case TypeClass_LONG: + { + sal_Int32 n = pVar->GetLong(); + if( n >= -128 && n <= 127 ) + aType = ::getCppuType( (sal_Int8*)0 ); + else if( n >= SbxMININT && n <= SbxMAXINT ) + aType = ::getCppuType( (sal_Int16*)0 ); + break; + } + case TypeClass_UNSIGNED_SHORT: + { + sal_uInt16 n = pVar->GetUShort(); + if( n <= 255 ) + aType = ::getCppuType( (sal_uInt8*)0 ); + break; + } + case TypeClass_UNSIGNED_LONG: + { + sal_uInt32 n = pVar->GetLong(); + if( n <= 255 ) + aType = ::getCppuType( (sal_uInt8*)0 ); + else if( n <= SbxMAXUINT ) + aType = ::getCppuType( (sal_uInt16*)0 ); + break; + } + default: break; + } + } + + return sbxToUnoValue( pVar, aType ); +} + + + +// Helper function for StepREDIMP +static Any implRekMultiDimArrayToSequence( SbxDimArray* pArray, + const Type& aElemType, short nMaxDimIndex, short nActualDim, + sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds ) +{ + sal_Int32 nSeqLevel = nMaxDimIndex - nActualDim + 1; + OUString aSeqTypeName; + sal_Int32 i; + for( i = 0 ; i < nSeqLevel ; i++ ) + aSeqTypeName += aSeqLevelStr; + + aSeqTypeName += aElemType.getTypeName(); + Type aSeqType( TypeClass_SEQUENCE, aSeqTypeName ); + + // Create Sequence instance + Any aRetVal; + Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( aSeqType ); + xIdlTargetClass->createObject( aRetVal ); + + // Alloc sequence according to array bounds + sal_Int32 nUpper = pUpperBounds[nActualDim]; + sal_Int32 nLower = pLowerBounds[nActualDim]; + sal_Int32 nSeqSize = nUpper - nLower + 1; + Reference< XIdlArray > xArray = xIdlTargetClass->getArray(); + xArray->realloc( aRetVal, nSeqSize ); + + sal_Int32& ri = pActualIndices[nActualDim]; + + for( ri = nLower,i = 0 ; ri <= nUpper ; ri++,i++ ) + { + Any aElementVal; + + if( nActualDim < nMaxDimIndex ) + { + aElementVal = implRekMultiDimArrayToSequence( pArray, aElemType, + nMaxDimIndex, nActualDim + 1, pActualIndices, pLowerBounds, pUpperBounds ); + } + else + { + SbxVariable* pSource = pArray->Get32( pActualIndices ); + aElementVal = sbxToUnoValue( pSource, aElemType ); + } + + try + { + // In die Sequence uebernehmen + xArray->set( aRetVal, i, aElementVal ); + } + catch( IllegalArgumentException& e1 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, + implGetExceptionMsg( e1, aIllegalArgumentExceptionName ) ); + } + catch (IndexOutOfBoundsException&) + { + StarBASIC::Error( SbERR_OUT_OF_RANGE ); + } + } + return aRetVal; +} + +// Konvertierung von Sbx nach Uno mit bekannter Zielklasse +Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty ) +{ + Any aRetVal; + + // #94560 No conversion of empty/void for MAYBE_VOID properties + if( pUnoProperty && pUnoProperty->Attributes & PropertyAttribute::MAYBEVOID ) + { + if( pVar->IsEmpty() ) + return aRetVal; + } + + SbxDataType eBaseType = pVar->SbxValue::GetType(); + if( eBaseType == SbxOBJECT ) + { + SbxBaseRef xObj = (SbxBase*)pVar->GetObject(); + if( xObj.Is() && xObj->ISA(SbUnoAnyObject) ) + { + return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue(); + } + } + + TypeClass eType = rType.getTypeClass(); + switch( eType ) + { + case TypeClass_INTERFACE: + case TypeClass_STRUCT: + case TypeClass_EXCEPTION: + { + Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( rType ); + + // Null-Referenz? + if( pVar->IsNull() && eType == TypeClass_INTERFACE ) + { + Reference< XInterface > xRef; + OUString aClassName = xIdlTargetClass->getName(); + Type aClassType( xIdlTargetClass->getTypeClass(), aClassName.getStr() ); + aRetVal.setValue( &xRef, aClassType ); + } + } + break; + + /* folgende Typen lassen wir erstmal weg + case TypeClass_SERVICE: break; + case TypeClass_CLASS: break; + case TypeClass_TYPEDEF: break; + case TypeClass_UNION: break; + case TypeClass_ENUM: break; + case TypeClass_ARRAY: break; + */ + + // Array -> Sequence + case TypeClass_ENUM: + { + aRetVal = int2enum( pVar->GetLong(), rType ); + } + break; + + case TypeClass_SEQUENCE: + { + SbxBaseRef xObj = (SbxBase*)pVar->GetObject(); + if( xObj && xObj->ISA(SbxDimArray) ) + { + SbxBase* pObj = (SbxBase*)xObj; + SbxDimArray* pArray = (SbxDimArray*)pObj; + + short nDims = pArray->GetDims(); + + // Normal case: One dimensional array + sal_Int32 nLower, nUpper; + if( nDims == 1 && pArray->GetDim32( 1, nLower, nUpper ) ) + { + sal_Int32 nSeqSize = nUpper - nLower + 1; + + // Instanz der geforderten Sequence erzeugen + Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( rType ); + xIdlTargetClass->createObject( aRetVal ); + Reference< XIdlArray > xArray = xIdlTargetClass->getArray(); + xArray->realloc( aRetVal, nSeqSize ); + + // Element-Type + OUString aClassName = xIdlTargetClass->getName(); + typelib_TypeDescription * pSeqTD = 0; + typelib_typedescription_getByName( &pSeqTD, aClassName.pData ); + OSL_ASSERT( pSeqTD ); + Type aElemType( ((typelib_IndirectTypeDescription *)pSeqTD)->pType ); + // Reference< XIdlClass > xElementClass = TypeToIdlClass( aElemType ); + + // Alle Array-Member umwandeln und eintragen + sal_Int32 nIdx = nLower; + for( sal_Int32 i = 0 ; i < nSeqSize ; i++,nIdx++ ) + { + SbxVariableRef xVar = pArray->Get32( &nIdx ); + + // Wert von Sbx nach Uno wandeln + Any aAnyValue = sbxToUnoValue( (SbxVariable*)xVar, aElemType ); + + try + { + // In die Sequence uebernehmen + xArray->set( aRetVal, i, aAnyValue ); + } + catch( IllegalArgumentException& e1 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, + implGetExceptionMsg( e1, aIllegalArgumentExceptionName ) ); + } + catch (IndexOutOfBoundsException&) + { + StarBASIC::Error( SbERR_OUT_OF_RANGE ); + } + } + } + // #i33795 Map also multi dimensional arrays to corresponding sequences + else if( nDims > 1 ) + { + // Element-Type + typelib_TypeDescription * pSeqTD = 0; + Type aCurType( rType ); + sal_Int32 nSeqLevel = 0; + Type aElemType; + do + { + OUString aTypeName = aCurType.getTypeName(); + typelib_typedescription_getByName( &pSeqTD, aTypeName.pData ); + OSL_ASSERT( pSeqTD ); + if( pSeqTD->eTypeClass == typelib_TypeClass_SEQUENCE ) + { + aCurType = Type( ((typelib_IndirectTypeDescription *)pSeqTD)->pType ); + nSeqLevel++; + } + else + { + aElemType = aCurType; + break; + } + } + while( true ); + + if( nSeqLevel == nDims ) + { + sal_Int32* pLowerBounds = new sal_Int32[nDims]; + sal_Int32* pUpperBounds = new sal_Int32[nDims]; + sal_Int32* pActualIndices = new sal_Int32[nDims]; + for( short i = 1 ; i <= nDims ; i++ ) + { + sal_Int32 lBound, uBound; + pArray->GetDim32( i, lBound, uBound ); + + short j = i - 1; + pActualIndices[j] = pLowerBounds[j] = lBound; + pUpperBounds[j] = uBound; + } + + aRetVal = implRekMultiDimArrayToSequence( pArray, aElemType, + nDims - 1, 0, pActualIndices, pLowerBounds, pUpperBounds ); + + delete[] pUpperBounds; + delete[] pLowerBounds; + delete[] pActualIndices; + } + } + } + } + break; + + /* + case TypeClass_VOID: break; + case TypeClass_UNKNOWN: break; + */ + + // Bei Any die Klassen-unabhaengige Konvertierungs-Routine nutzen + case TypeClass_ANY: + { + aRetVal = sbxToUnoValueImpl( pVar ); + } + break; + + case TypeClass_BOOLEAN: + { + sal_Bool b = pVar->GetBool(); + aRetVal.setValue( &b, getBooleanCppuType() ); + break; + } + case TypeClass_CHAR: + { + sal_Unicode c = pVar->GetChar(); + aRetVal.setValue( &c , getCharCppuType() ); + break; + } + case TypeClass_STRING: aRetVal <<= OUString( pVar->GetString() ); break; + case TypeClass_FLOAT: aRetVal <<= pVar->GetSingle(); break; + case TypeClass_DOUBLE: aRetVal <<= pVar->GetDouble(); break; + //case TypeClass_OCTET: break; + + case TypeClass_BYTE: + { + sal_Int16 nVal = pVar->GetInteger(); + sal_Bool bOverflow = sal_False; + if( nVal < -128 ) + { + bOverflow = sal_True; + nVal = -128; + } + else if( nVal > 127 ) + { + bOverflow = sal_True; + nVal = 127; + } + if( bOverflow ) + StarBASIC::Error( ERRCODE_BASIC_MATH_OVERFLOW ); + + sal_Int8 nByteVal = (sal_Int8)nVal; + aRetVal <<= nByteVal; + break; + } + //case TypeClass_INT: break; + case TypeClass_SHORT: aRetVal <<= (sal_Int16)( pVar->GetInteger() ); break; + case TypeClass_LONG: aRetVal <<= (sal_Int32)( pVar->GetLong() ); break; + case TypeClass_HYPER: aRetVal <<= (sal_Int64)( pVar->GetInt64() ); break; + //case TypeClass_UNSIGNED_OCTET:break; + case TypeClass_UNSIGNED_SHORT: aRetVal <<= (sal_uInt16)( pVar->GetUShort() ); break; + case TypeClass_UNSIGNED_LONG: aRetVal <<= (sal_uInt32)( pVar->GetULong() ); break; + case TypeClass_UNSIGNED_HYPER: aRetVal <<= (sal_uInt64)( pVar->GetUInt64() ); break; + //case TypeClass_UNSIGNED_INT: break; + //case TypeClass_UNSIGNED_BYTE: break; + default: break; + } + + return aRetVal; +} + +// Dbg-Hilfsmethode zum Auslesen der in einem Object implementierten Interfaces +String Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, USHORT nRekLevel ) +{ + Type aIfaceType = ::getCppuType( (const Reference< XInterface > *)0 ); + static Reference< XIdlClass > xIfaceClass = TypeToIdlClass( aIfaceType ); + + String aRetStr; + for( USHORT i = 0 ; i < nRekLevel ; i++ ) + aRetStr.AppendAscii( " " ); + aRetStr += String( xClass->getName() ); + OUString aClassName = xClass->getName(); + Type aClassType( xClass->getTypeClass(), aClassName.getStr() ); + + // Pruefen, ob das Interface wirklich unterstuetzt wird + if( !x->queryInterface( aClassType ).hasValue() ) + { + aRetStr.AppendAscii( " (ERROR: Not really supported!)\n" ); + } + // Gibt es Super-Interfaces + else + { + aRetStr.AppendAscii( "\n" ); + + // Super-Interfaces holen + Sequence< Reference< XIdlClass > > aSuperClassSeq = xClass->getSuperclasses(); + const Reference< XIdlClass >* pClasses = aSuperClassSeq.getConstArray(); + UINT32 nSuperIfaceCount = aSuperClassSeq.getLength(); + for( UINT32 j = 0 ; j < nSuperIfaceCount ; j++ ) + { + const Reference< XIdlClass >& rxIfaceClass = pClasses[j]; + if( !rxIfaceClass->equals( xIfaceClass ) ) + aRetStr += Impl_GetInterfaceInfo( x, rxIfaceClass, nRekLevel + 1 ); + } + } + return aRetStr; +} + +String getDbgObjectNameImpl( SbUnoObject* pUnoObj ) +{ + String aName; + if( pUnoObj ) + { + aName = pUnoObj->GetClassName(); + if( !aName.Len() ) + { + Any aToInspectObj = pUnoObj->getUnoAny(); + TypeClass eType = aToInspectObj.getValueType().getTypeClass(); + Reference< XInterface > xObj; + if( eType == TypeClass_INTERFACE ) + xObj = *(Reference< XInterface >*)aToInspectObj.getValue(); + if( xObj.is() ) + { + Reference< XServiceInfo > xServiceInfo( xObj, UNO_QUERY ); + if( xServiceInfo.is() ) + aName = xServiceInfo->getImplementationName(); + } + } + } + return aName; +} + +String getDbgObjectName( SbUnoObject* pUnoObj ) +{ + String aName = getDbgObjectNameImpl( pUnoObj ); + if( !aName.Len() ) + aName.AppendAscii( "Unknown" ); + + String aRet; + if( aName.Len() > 20 ) + aRet.AppendAscii( "\n" ); + aRet.AppendAscii( "\"" ); + aRet += aName; + aRet.AppendAscii( "\":" ); + return aRet; +} + +// Dbg-Hilfsmethode zum Auslesen der in einem Object implementierten Interfaces +String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) +{ + Any aToInspectObj = pUnoObj->getUnoAny(); + + // #54898: Nur TypeClass Interface zulasssen + TypeClass eType = aToInspectObj.getValueType().getTypeClass(); + String aRet; + if( eType != TypeClass_INTERFACE ) + { + aRet += ID_DBG_SUPPORTEDINTERFACES; + aRet.AppendAscii( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" ); + } + else + { + // Interface aus dem Any besorgen + const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue(); + + Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY ); + + aRet.AssignAscii( "Supported interfaces by object " ); + String aObjName = getDbgObjectName( pUnoObj ); + aRet += aObjName; + aRet.AppendAscii( "\n" ); + if( xTypeProvider.is() ) + { + // Interfaces der Implementation holen + Sequence< Type > aTypeSeq = xTypeProvider->getTypes(); + const Type* pTypeArray = aTypeSeq.getConstArray(); + UINT32 nIfaceCount = aTypeSeq.getLength(); + for( UINT32 j = 0 ; j < nIfaceCount ; j++ ) + { + const Type& rType = pTypeArray[j]; + + Reference xClass = TypeToIdlClass( rType ); + if( xClass.is() ) + { + aRet += Impl_GetInterfaceInfo( x, xClass, 1 ); + } + else + { + typelib_TypeDescription * pTD = 0; + rType.getDescription( &pTD ); + String TypeName( OUString( pTD->pTypeName ) ); + + aRet.AppendAscii( "*** ERROR: No IdlClass for type \"" ); + aRet += TypeName; + aRet.AppendAscii( "\"\n*** Please check type library\n" ); + } + } + } + } + return aRet; +} + + + +// Dbg-Hilfsmethode SbxDataType -> String +String Dbg_SbxDataType2String( SbxDataType eType ) +{ + String aRet( RTL_CONSTASCII_USTRINGPARAM("Unknown Sbx-Type!") ); + switch( +eType ) + { + case SbxEMPTY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxEMPTY") ); break; + case SbxNULL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxNULL") ); break; + case SbxINTEGER: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINTEGER") ); break; + case SbxLONG: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLONG") ); break; + case SbxSINGLE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxSINGLE") ); break; + case SbxDOUBLE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDOUBLE") ); break; + case SbxCURRENCY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCURRENCY") ); break; + case SbxDECIMAL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDECIMAL") ); break; + case SbxDATE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDATE") ); break; + case SbxSTRING: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxSTRING") ); break; + case SbxOBJECT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxOBJECT") ); break; + case SbxERROR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxERROR") ); break; + case SbxBOOL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxBOOL") ); break; + case SbxVARIANT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxVARIANT") ); break; + case SbxDATAOBJECT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDATAOBJECT") ); break; + case SbxCHAR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCHAR") ); break; + case SbxBYTE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxBYTE") ); break; + case SbxUSHORT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUSHORT") ); break; + case SbxULONG: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxULONG") ); break; + case SbxLONG64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLONG64") ); break; + case SbxULONG64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxULONG64") ); break; + case SbxSALINT64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINT64") ); break; + case SbxSALUINT64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUINT64") ); break; + case SbxINT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINT") ); break; + case SbxUINT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUINT") ); break; + case SbxVOID: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxVOID") ); break; + case SbxHRESULT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxHRESULT") ); break; + case SbxPOINTER: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxPOINTER") ); break; + case SbxDIMARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDIMARRAY") ); break; + case SbxCARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCARRAY") ); break; + case SbxUSERDEF: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUSERDEF") ); break; + case SbxLPSTR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLPSTR") ); break; + case SbxLPWSTR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLPWSTR") ); break; + case SbxCoreSTRING: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCoreSTRING" ) ); break; + case SbxOBJECT | SbxARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxARRAY") ); break; + default: break; + } + return aRet; +} + +// Dbg-Hilfsmethode zum Anzeigen der Properties eines SbUnoObjects +String Impl_DumpProperties( SbUnoObject* pUnoObj ) +{ + String aRet( RTL_CONSTASCII_USTRINGPARAM("Properties of object ") ); + String aObjName = getDbgObjectName( pUnoObj ); + aRet += aObjName; + + // Uno-Infos auswerten, um Arrays zu erkennen + Reference< XIntrospectionAccess > xAccess = pUnoObj->getIntrospectionAccess(); + if( !xAccess.is() ) + { + Reference< XInvocation > xInvok = pUnoObj->getInvocation(); + if( xInvok.is() ) + xAccess = xInvok->getIntrospection(); + } + if( !xAccess.is() ) + { + aRet.AppendAscii( "\nUnknown, no introspection available\n" ); + return aRet; + } + + Sequence props = xAccess->getProperties( PropertyConcept::ALL - PropertyConcept::DANGEROUS ); + UINT32 nUnoPropCount = props.getLength(); + const Property* pUnoProps = props.getConstArray(); + + SbxArray* pProps = pUnoObj->GetProperties(); + USHORT nPropCount = pProps->Count(); + USHORT nPropsPerLine = 1 + nPropCount / 30; + for( USHORT i = 0; i < nPropCount; i++ ) + { + SbxVariable* pVar = pProps->Get( i ); + if( pVar ) + { + String aPropStr; + if( (i % nPropsPerLine) == 0 ) + aPropStr.AppendAscii( "\n" ); + + // Typ und Namen ausgeben + // Ist es in Uno eine Sequence? + SbxDataType eType = pVar->GetFullType(); + + BOOL bMaybeVoid = FALSE; + if( i < nUnoPropCount ) + { + const Property& rProp = pUnoProps[ i ]; + + // #63133: Bei MAYBEVOID Typ aus Uno neu konvertieren, + // damit nicht immer nur SbxEMPTY ausgegben wird. + if( rProp.Attributes & PropertyAttribute::MAYBEVOID ) + { + eType = unoToSbxType( rProp.Type.getTypeClass() ); + bMaybeVoid = TRUE; + } + if( eType == SbxOBJECT ) + { + Type aType = rProp.Type; + if( aType.getTypeClass() == TypeClass_SEQUENCE ) + eType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); + } + } + aPropStr += Dbg_SbxDataType2String( eType ); + if( bMaybeVoid ) + aPropStr.AppendAscii( "/void" ); + aPropStr.AppendAscii( " " ); + aPropStr += pVar->GetName(); + + if( i == nPropCount - 1 ) + aPropStr.AppendAscii( "\n" ); + else + aPropStr.AppendAscii( "; " ); + + aRet += aPropStr; + } + } + return aRet; +} + +// Dbg-Hilfsmethode zum Anzeigen der Methoden eines SbUnoObjects +String Impl_DumpMethods( SbUnoObject* pUnoObj ) +{ + String aRet( RTL_CONSTASCII_USTRINGPARAM("Methods of object ") ); + String aObjName = getDbgObjectName( pUnoObj ); + aRet += aObjName; + + // XIntrospectionAccess, um die Typen der Parameter auch ausgeben zu koennen + Reference< XIntrospectionAccess > xAccess = pUnoObj->getIntrospectionAccess(); + if( !xAccess.is() ) + { + Reference< XInvocation > xInvok = pUnoObj->getInvocation(); + if( xInvok.is() ) + xAccess = xInvok->getIntrospection(); + } + if( !xAccess.is() ) + { + aRet.AppendAscii( "\nUnknown, no introspection available\n" ); + return aRet; + } + Sequence< Reference< XIdlMethod > > methods = xAccess->getMethods + ( MethodConcept::ALL - MethodConcept::DANGEROUS ); + const Reference< XIdlMethod >* pUnoMethods = methods.getConstArray(); + + SbxArray* pMethods = pUnoObj->GetMethods(); + USHORT nMethodCount = pMethods->Count(); + if( !nMethodCount ) + { + aRet.AppendAscii( "\nNo methods found\n" ); + return aRet; + } + USHORT nPropsPerLine = 1 + nMethodCount / 30; + for( USHORT i = 0; i < nMethodCount; i++ ) + { + SbxVariable* pVar = pMethods->Get( i ); + if( pVar ) + { + String aPropStr; + if( (i % nPropsPerLine) == 0 ) + aPropStr.AppendAscii( "\n" ); + + // Methode ansprechen + const Reference< XIdlMethod >& rxMethod = pUnoMethods[i]; + + // Ist es in Uno eine Sequence? + SbxDataType eType = pVar->GetFullType(); + if( eType == SbxOBJECT ) + { + Reference< XIdlClass > xClass = rxMethod->getReturnType(); + if( xClass.is() && xClass->getTypeClass() == TypeClass_SEQUENCE ) + eType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); + } + // Name und Typ ausgeben + aPropStr += Dbg_SbxDataType2String( eType ); + aPropStr.AppendAscii( " " ); + aPropStr += pVar->GetName(); + aPropStr.AppendAscii( " ( " ); + + // get-Methode darf keinen Parameter haben + Sequence< Reference< XIdlClass > > aParamsSeq = rxMethod->getParameterTypes(); + UINT32 nParamCount = aParamsSeq.getLength(); + const Reference< XIdlClass >* pParams = aParamsSeq.getConstArray(); + + if( nParamCount > 0 ) + { + for( USHORT j = 0; j < nParamCount; j++ ) + { + String aTypeStr = Dbg_SbxDataType2String( unoToSbxType( pParams[ j ] ) ); + aPropStr += aTypeStr; + + if( j < nParamCount - 1 ) + aPropStr.AppendAscii( ", " ); + } + } + else + aPropStr.AppendAscii( "void" ); + + aPropStr.AppendAscii( " ) " ); + + if( i == nMethodCount - 1 ) + aPropStr.AppendAscii( "\n" ); + else + aPropStr.AppendAscii( "; " ); + + aRet += aPropStr; + } + } + return aRet; +} + +TYPEINIT1(AutomationNamedArgsSbxArray,SbxArray) + +// Implementation SbUnoObject +void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + if( bNeedIntrospection ) + doIntrospection(); + + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pParams = pVar->GetParameters(); + SbUnoProperty* pProp = PTR_CAST(SbUnoProperty,pVar); + SbUnoMethod* pMeth = PTR_CAST(SbUnoMethod,pVar); + if( pProp ) + { + bool bInvocation = pProp->isInvocationBased(); + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + // Test-Properties + INT32 nId = pProp->nId; + if( nId < 0 ) + { + // Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen + if( nId == -1 ) // Property ID_DBG_SUPPORTEDINTERFACES" + { + String aRetStr = Impl_GetSupportedInterfaces( this ); + pVar->PutString( aRetStr ); + } + // Id == -2: Properties ausgeben + else if( nId == -2 ) // Property ID_DBG_PROPERTIES + { + // Jetzt muessen alle Properties angelegt werden + implCreateAll(); + String aRetStr = Impl_DumpProperties( this ); + pVar->PutString( aRetStr ); + } + // Id == -3: Methoden ausgeben + else if( nId == -3 ) // Property ID_DBG_METHODS + { + // Jetzt muessen alle Properties angelegt werden + implCreateAll(); + String aRetStr = Impl_DumpMethods( this ); + pVar->PutString( aRetStr ); + } + return; + } + + if( !bInvocation && mxUnoAccess.is() ) + { + try + { + // Wert holen + Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY ); + Any aRetAny = xPropSet->getPropertyValue( pProp->GetName() ); + // Die Nutzung von getPropertyValue (statt ueber den Index zu gehen) ist + // nicht optimal, aber die Umstellung auf XInvocation steht ja ohnehin an + // Ansonsten kann auch FastPropertySet genutzt werden + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + } + catch( BasicErrorException& e0 ) + { + implHandleBasicErrorException( e0 ); + } + catch( WrappedTargetException& e1 ) + { + implHandleWrappedTargetException( e1 ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2 ) ); + } + catch( Exception& e3 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e3 ) ); + } + } + else if( bInvocation && mxInvocation.is() ) + { + try + { + // Wert holen + Any aRetAny = mxInvocation->getValue( pProp->GetName() ); + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + } + catch( BasicErrorException& e0 ) + { + implHandleBasicErrorException( e0 ); + } + catch( WrappedTargetException& e1 ) + { + implHandleWrappedTargetException( e1 ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2 ) ); + } + catch( Exception& e3 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e3 ) ); + } + } + } + else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + { + if( !bInvocation && mxUnoAccess.is() ) + { + if( pProp->aUnoProp.Attributes & PropertyAttribute::READONLY ) + { + StarBASIC::Error( SbERR_PROP_READONLY ); + return; + } + + // Wert von Uno nach Sbx uebernehmen + Any aAnyValue = sbxToUnoValue( pVar, pProp->aUnoProp.Type, &pProp->aUnoProp ); + try + { + // Wert setzen + Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY ); + xPropSet->setPropertyValue( pProp->GetName(), aAnyValue ); + // Die Nutzung von getPropertyValue (statt ueber den Index zu gehen) ist + // nicht optimal, aber die Umstellung auf XInvocation steht ja ohnehin an + // Ansonsten kann auch FastPropertySet genutzt werden + } + catch( BasicErrorException& e0 ) + { + implHandleBasicErrorException( e0 ); + } + catch( WrappedTargetException& e1 ) + { + implHandleWrappedTargetException( e1 ); + } + catch( IllegalArgumentException& e2 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, + implGetExceptionMsg( e2, aIllegalArgumentExceptionName ) ); + } + catch( RuntimeException& e3 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e3 ) ); + } + catch( Exception& e4 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e4 ) ); + } + } + else if( bInvocation && mxInvocation.is() ) + { + // Wert von Uno nach Sbx uebernehmen + Any aAnyValue = sbxToUnoValueImpl( pVar ); + try + { + // Wert setzen + mxInvocation->setValue( pProp->GetName(), aAnyValue ); + } + catch( BasicErrorException& e0 ) + { + implHandleBasicErrorException( e0 ); + } + catch( WrappedTargetException& e1 ) + { + implHandleWrappedTargetException( e1 ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2 ) ); + } + catch( Exception& e3 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e3 ) ); + } + } + } + } + else if( pMeth ) + { + bool bInvocation = pMeth->isInvocationBased(); + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + // Anzahl Parameter -1 wegen Param0 == this + UINT32 nParamCount = pParams ? ((UINT32)pParams->Count() - 1) : 0; + Sequence args; + BOOL bOutParams = FALSE; + UINT32 i; + + if( !bInvocation && mxUnoAccess.is() ) + { + // Infos holen + const Sequence& rInfoSeq = pMeth->getParamInfos(); + const ParamInfo* pParamInfos = rInfoSeq.getConstArray(); + UINT32 nUnoParamCount = rInfoSeq.getLength(); + UINT32 nAllocParamCount = nParamCount; + + // Ueberschuessige Parameter ignorieren, Alternative: Error schmeissen + if( nParamCount > nUnoParamCount ) + { + nParamCount = nUnoParamCount; + nAllocParamCount = nParamCount; + } + + if( nAllocParamCount > 0 ) + { + args.realloc( nAllocParamCount ); + Any* pAnyArgs = args.getArray(); + for( i = 0 ; i < nParamCount ; i++ ) + { + const ParamInfo& rInfo = pParamInfos[i]; + const Reference< XIdlClass >& rxClass = rInfo.aType; + //const XIdlClassRef& rxClass = pUnoParams[i]; + + com::sun::star::uno::Type aType( rxClass->getTypeClass(), rxClass->getName() ); + + // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! + pAnyArgs[i] = sbxToUnoValue( pParams->Get( (USHORT)(i+1) ), aType ); + + // Wenn es nicht schon feststeht pruefen, ob Out-Parameter vorliegen + if( !bOutParams ) + { + ParamMode aParamMode = rInfo.aMode; + if( aParamMode != ParamMode_IN ) + bOutParams = TRUE; + } + } + } + } + else if( bInvocation && pParams && mxInvocation.is() ) + { + bool bOLEAutomation = true; + // TODO: bOLEAutomation = xOLEAutomation.is() + + AutomationNamedArgsSbxArray* pArgNamesArray = NULL; + if( bOLEAutomation ) + pArgNamesArray = PTR_CAST(AutomationNamedArgsSbxArray,pParams); + + args.realloc( nParamCount ); + Any* pAnyArgs = args.getArray(); + bool bBlockConversionToSmallestType( false ); + + if( pArgNamesArray ) + { + Sequence< OUString >& rNameSeq = pArgNamesArray->getNames(); + OUString* pNames = rNameSeq.getArray(); + + Any aValAny; + for( i = 0 ; i < nParamCount ; i++ ) + { + USHORT iSbx = (USHORT)(i+1); + + // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! + aValAny = sbxToUnoValueImpl( pParams->Get( iSbx ), + bBlockConversionToSmallestType ); + + OUString aParamName = pNames[iSbx]; + if( aParamName.getLength() ) + { + oleautomation::NamedArgument aNamedArgument; + aNamedArgument.Name = aParamName; + aNamedArgument.Value = aValAny; + pAnyArgs[i] <<= aNamedArgument; + } + else + { + pAnyArgs[i] = aValAny; + } + } + } + else + { + for( i = 0 ; i < nParamCount ; i++ ) + { + // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! + pAnyArgs[i] = sbxToUnoValueImpl( pParams->Get( (USHORT)(i+1) ), + bBlockConversionToSmallestType ); + } + } + } + + // Methode callen + GetSbData()->bBlockCompilerError = TRUE; // #106433 Block compiler errors for API calls + try + { + if( !bInvocation && mxUnoAccess.is() ) + { + Any aRetAny = pMeth->m_xUnoMethod->invoke( getUnoAny(), args ); + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + + // Muessen wir Out-Parameter zurueckkopieren? + if( bOutParams ) + { + const Any* pAnyArgs = args.getConstArray(); + + // Infos holen + const Sequence& rInfoSeq = pMeth->getParamInfos(); + const ParamInfo* pParamInfos = rInfoSeq.getConstArray(); + + UINT32 j; + for( j = 0 ; j < nParamCount ; j++ ) + { + const ParamInfo& rInfo = pParamInfos[j]; + ParamMode aParamMode = rInfo.aMode; + if( aParamMode != ParamMode_IN ) + unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(j+1) ), pAnyArgs[ j ] ); + } + } + } + else if( bInvocation && mxInvocation.is() ) + { + Sequence< INT16 > OutParamIndex; + Sequence< Any > OutParam; + Any aRetAny = mxInvocation->invoke( pMeth->GetName(), args, OutParamIndex, OutParam ); + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + + const INT16* pIndices = OutParamIndex.getConstArray(); + UINT32 nLen = OutParamIndex.getLength(); + if( nLen ) + { + const Any* pNewValues = OutParam.getConstArray(); + for( UINT32 j = 0 ; j < nLen ; j++ ) + { + INT16 iTarget = pIndices[ j ]; + if( iTarget >= (INT16)nParamCount ) + break; + unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(j+1) ), pNewValues[ j ] ); + } + } + } + + // #55460, Parameter hier weghauen, da das in unoToSbxValue() + // bei Arrays wegen #54548 nicht mehr gemacht wird + if( pParams ) + pVar->SetParameters( NULL ); + } + catch( BasicErrorException& e0 ) + { + implHandleBasicErrorException( e0 ); + } + catch( WrappedTargetException& e1 ) + { + implHandleWrappedTargetException( e1 ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2 ) ); + } + catch( IllegalArgumentException& e3) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, + implGetExceptionMsg( e3, aIllegalArgumentExceptionName ) ); + } + catch( Exception& e4 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e4 ) ); + } + GetSbData()->bBlockCompilerError = FALSE; // #106433 Unblock compiler errors + } + } + else + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + + +#ifdef INVOCATION_ONLY +// Aus USR +Reference< XInvocation > createDynamicInvocationFor( const Any& aAny ); +#endif + +SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) + : SbxObject( aName_ ) +{ + static Reference< XIntrospection > xIntrospection; + + // Default-Properties von Sbx wieder rauspruegeln + Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_DONTCARE ); + Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Parent") ), SbxCLASS_DONTCARE ); + + // Typ des Objekts pruefen + TypeClass eType = aUnoObj_.getValueType().getTypeClass(); + Reference< XInterface > x; + if( eType == TypeClass_INTERFACE ) + { + // Interface aus dem Any besorgen + x = *(Reference< XInterface >*)aUnoObj_.getValue(); + if( !x.is() ) + return; + } + + Reference< XTypeProvider > xTypeProvider; +#ifdef INVOCATION_ONLY + // Invocation besorgen + mxInvocation = createDynamicInvocationFor( aUnoObj_ ); +#else + // Hat das Object selbst eine Invocation? + mxInvocation = Reference< XInvocation >( x, UNO_QUERY ); + + xTypeProvider = Reference< XTypeProvider >( x, UNO_QUERY ); +#endif + + if( mxInvocation.is() ) + { + // #94670: This is WRONG because then the MaterialHolder doesn't refer + // to the object implementing XInvocation but to the object passed to + // the invocation service!!! + // mxMaterialHolder = Reference< XMaterialHolder >::query( mxInvocation ); + + // ExactName holen + mxExactNameInvocation = Reference< XExactName >::query( mxInvocation ); + + // Rest bezieht sich nur auf Introspection + if( !xTypeProvider.is() ) + { + bNeedIntrospection = FALSE; + return; + } + } + + // Introspection-Flag + bNeedIntrospection = TRUE; + maTmpUnoObj = aUnoObj_; + + + //*** Namen bestimmen *** + BOOL bFatalError = TRUE; + + // Ist es ein Interface oder eine struct? + BOOL bSetClassName = FALSE; + String aClassName_; + if( eType == TypeClass_STRUCT || eType == TypeClass_EXCEPTION ) + { + // Struct ist Ok + bFatalError = FALSE; + + // #67173 Echten Klassen-Namen eintragen + if( aName_.Len() == 0 ) + { + aClassName_ = String( aUnoObj_.getValueType().getTypeName() ); + bSetClassName = TRUE; + } + } + else if( eType == TypeClass_INTERFACE ) + { + // #70197 Interface geht immer durch Typ im Any + bFatalError = FALSE; + } + if( bSetClassName ) + SetClassName( aClassName_ ); + + // Weder Interface noch Struct -> FatalError + if( bFatalError ) + { + StarBASIC::FatalError( ERRCODE_BASIC_EXCEPTION ); + return; + } + + // #67781 Introspection erst on demand durchfuehren +} + +SbUnoObject::~SbUnoObject() +{ +} + + +// #76470 Introspection on Demand durchfuehren +void SbUnoObject::doIntrospection( void ) +{ + static Reference< XIntrospection > xIntrospection; + + if( !bNeedIntrospection ) + return; + bNeedIntrospection = FALSE; + + if( !xIntrospection.is() ) + { + // Introspection-Service holen + Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() ); + if ( xFactory.is() ) + { + Reference< XInterface > xI = xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.Introspection" )) ); + if (xI.is()) + xIntrospection = Reference< XIntrospection >::query( xI ); + //xI->queryInterface( ::getCppuType( (const Reference< XIntrospection > *)0 ), xIntrospection ); + } + } + if( !xIntrospection.is() ) + { + StarBASIC::FatalError( ERRCODE_BASIC_EXCEPTION ); + return; + } + + // Introspection durchfuehren + try + { + mxUnoAccess = xIntrospection->inspect( maTmpUnoObj ); + } + catch( RuntimeException& e ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e ) ); + } + + if( !mxUnoAccess.is() ) + { + // #51475 Ungueltiges Objekt kennzeichnen (kein mxMaterialHolder) + return; + } + + // MaterialHolder vom Access holen + mxMaterialHolder = Reference< XMaterialHolder >::query( mxUnoAccess ); + + // ExactName vom Access holen + mxExactName = Reference< XExactName >::query( mxUnoAccess ); +} + + + + +// #67781 Start einer Liste aller SbUnoMethod-Instanzen +static SbUnoMethod* pFirst = NULL; + +SbUnoMethod::SbUnoMethod +( + const String& aName_, + SbxDataType eSbxType, + Reference< XIdlMethod > xUnoMethod_, + bool bInvocation +) + : SbxMethod( aName_, eSbxType ) + , mbInvocation( bInvocation ) +{ + m_xUnoMethod = xUnoMethod_; + pParamInfoSeq = NULL; + + // #67781 Methode in Liste eintragen + pNext = pFirst; + pPrev = NULL; + pFirst = this; + if( pNext ) + pNext->pPrev = this; +} + +SbUnoMethod::~SbUnoMethod() +{ + delete pParamInfoSeq; + + if( this == pFirst ) + pFirst = pNext; + else if( pPrev ) + pPrev->pNext = pNext; + if( pNext ) + pNext->pPrev = pPrev; +} + +SbxInfo* SbUnoMethod::GetInfo() +{ + return pInfo; +} + +const Sequence& SbUnoMethod::getParamInfos( void ) +{ + if( !pParamInfoSeq && m_xUnoMethod.is() ) + { + Sequence aTmp = m_xUnoMethod->getParameterInfos() ; + pParamInfoSeq = new Sequence( aTmp ); + } + return *pParamInfoSeq; +} + +SbUnoProperty::SbUnoProperty +( + const String& aName_, + SbxDataType eSbxType, + const Property& aUnoProp_, + INT32 nId_, + bool bInvocation +) + : SbxProperty( aName_, eSbxType ) + , aUnoProp( aUnoProp_ ) + , nId( nId_ ) + , mbInvocation( bInvocation ) +{ + // #54548, bei bedarf Dummy-Array einsetzen, damit SbiRuntime::CheckArray() geht + static SbxArrayRef xDummyArray = new SbxArray( SbxVARIANT ); + if( eSbxType & SbxARRAY ) + PutObject( xDummyArray ); +} + +SbUnoProperty::~SbUnoProperty() +{} + + +SbxVariable* SbUnoObject::Find( const XubString& rName, SbxClassType t ) +{ + static Reference< XIdlMethod > xDummyMethod; + static Property aDummyProp; + + SbxVariable* pRes = SbxObject::Find( rName, t ); + + if( bNeedIntrospection ) + doIntrospection(); + + // Neu 4.3.1999: Properties on Demand anlegen, daher jetzt perIntrospectionAccess + // suchen, ob doch eine Property oder Methode des geforderten Namens existiert + if( !pRes ) + { + OUString aUName( rName ); + if( mxUnoAccess.is() ) + { + if( mxExactName.is() ) + { + OUString aUExactName = mxExactName->getExactName( aUName ); + if( aUExactName.getLength() ) + aUName = aUExactName; + } + if( mxUnoAccess->hasProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ) ) + { + const Property& rProp = mxUnoAccess-> + getProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ); + + // #58455 Wenn die Property void sein kann, muss als Typ Variant gesetzt werden + SbxDataType eSbxType; + if( rProp.Attributes & PropertyAttribute::MAYBEVOID ) + eSbxType = SbxVARIANT; + else + eSbxType = unoToSbxType( rProp.Type.getTypeClass() ); + + // Property anlegen und reinbraten + SbxVariableRef xVarRef = new SbUnoProperty( rProp.Name, eSbxType, rProp, 0, false ); + QuickInsert( (SbxVariable*)xVarRef ); + pRes = xVarRef; + } + else if( mxUnoAccess->hasMethod( aUName, + MethodConcept::ALL - MethodConcept::DANGEROUS ) ) + { + // Methode ansprechen + const Reference< XIdlMethod >& rxMethod = mxUnoAccess-> + getMethod( aUName, MethodConcept::ALL - MethodConcept::DANGEROUS ); + + // SbUnoMethode anlegen und reinbraten + SbxVariableRef xMethRef = new SbUnoMethod( rxMethod->getName(), + unoToSbxType( rxMethod->getReturnType() ), rxMethod, false ); + QuickInsert( (SbxVariable*)xMethRef ); + pRes = xMethRef; + } + + // Wenn immer noch nichts gefunden wurde, muss geprueft werden, ob NameAccess vorliegt + if( !pRes ) + { + try + { + Reference< XNameAccess > xNameAccess( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY ); + OUString aUName2( rName ); + + if( xNameAccess.is() && xNameAccess->hasByName( aUName2 ) ) + { + Any aAny = xNameAccess->getByName( aUName2 ); + + // ACHTUNG: Die hier erzeugte Variable darf wegen bei XNameAccess + // nicht als feste Property in das Object aufgenommen werden und + // wird daher nirgendwo gehalten. + // Wenn das Probleme gibt, muss das kuenstlich gemacht werden oder + // es muss eine Klasse SbUnoNameAccessProperty geschaffen werden, + // bei der die Existenz staendig neu ueberprueft und die ggf. weg- + // geworfen wird, wenn der Name nicht mehr gefunden wird. + pRes = new SbxVariable( SbxVARIANT ); + unoToSbxValue( pRes, aAny ); + } + } + catch( NoSuchElementException& e ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e ) ); + } + catch( BasicErrorException& e0 ) + { + // Anlegen, damit der Exception-Fehler nicht ueberschrieben wird + if( !pRes ) + pRes = new SbxVariable( SbxVARIANT ); + + implHandleBasicErrorException( e0 ); + } + catch( WrappedTargetException& e1 ) + { + // Anlegen, damit der Exception-Fehler nicht ueberschrieben wird + if( !pRes ) + pRes = new SbxVariable( SbxVARIANT ); + + implHandleWrappedTargetException( e1 ); + } + catch( RuntimeException& e2 ) + { + // Anlegen, damit der Exception-Fehler nicht ueberschrieben wird + if( !pRes ) + pRes = new SbxVariable( SbxVARIANT ); + + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2 ) ); + } + } + } + if( !pRes && mxInvocation.is() ) + { + if( mxExactNameInvocation.is() ) + { + OUString aUExactName = mxExactNameInvocation->getExactName( aUName ); + if( aUExactName.getLength() ) + aUName = aUExactName; + } + + try + { + if( mxInvocation->hasProperty( aUName ) ) + { + // Property anlegen und reinbraten + SbxVariableRef xVarRef = new SbUnoProperty( aUName, SbxVARIANT, aDummyProp, 0, true ); + QuickInsert( (SbxVariable*)xVarRef ); + pRes = xVarRef; + } + else if( mxInvocation->hasMethod( aUName ) ) + { + // SbUnoMethode anlegen und reinbraten + SbxVariableRef xMethRef = new SbUnoMethod( aUName, SbxVARIANT, xDummyMethod, true ); + QuickInsert( (SbxVariable*)xMethRef ); + pRes = xMethRef; + } + } + catch( RuntimeException& e ) + { + // Anlegen, damit der Exception-Fehler nicht ueberschrieben wird + if( !pRes ) + pRes = new SbxVariable( SbxVARIANT ); + + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e ) ); + } + } + } + + // Ganz am Schluss noch pruefen, ob die Dbg_-Properties gemeint sind + + if( !pRes ) + { + if( rName.EqualsIgnoreCaseAscii( ID_DBG_SUPPORTEDINTERFACES ) || + rName.EqualsIgnoreCaseAscii( ID_DBG_PROPERTIES ) || + rName.EqualsIgnoreCaseAscii( ID_DBG_METHODS ) ) + { + // Anlegen + implCreateDbgProperties(); + + // Jetzt muessen sie regulaer gefunden werden + pRes = SbxObject::Find( rName, SbxCLASS_DONTCARE ); + } + } + return pRes; +} + + +// Hilfs-Methode zum Anlegen der dbg_-Properties +void SbUnoObject::implCreateDbgProperties( void ) +{ + Property aProp; + + // Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen + SbxVariableRef xVarRef = new SbUnoProperty( ID_DBG_SUPPORTEDINTERFACES, SbxSTRING, aProp, -1, false ); + QuickInsert( (SbxVariable*)xVarRef ); + + // Id == -2: Properties ausgeben + xVarRef = new SbUnoProperty( ID_DBG_PROPERTIES, SbxSTRING, aProp, -2, false ); + QuickInsert( (SbxVariable*)xVarRef ); + + // Id == -3: Methoden ausgeben + xVarRef = new SbUnoProperty( ID_DBG_METHODS, SbxSTRING, aProp, -3, false ); + QuickInsert( (SbxVariable*)xVarRef ); +} + +void SbUnoObject::implCreateAll( void ) +{ + // Bestehende Methoden und Properties alle wieder wegwerfen + pMethods = new SbxArray; + pProps = new SbxArray; + + if( bNeedIntrospection ) doIntrospection(); + + // Instrospection besorgen + Reference< XIntrospectionAccess > xAccess = mxUnoAccess; + if( !xAccess.is() ) + { + if( mxInvocation.is() ) + xAccess = mxInvocation->getIntrospection(); + } + if( !xAccess.is() ) + return; + + // Properties anlegen + Sequence props = xAccess->getProperties( PropertyConcept::ALL - PropertyConcept::DANGEROUS ); + UINT32 nPropCount = props.getLength(); + const Property* pProps_ = props.getConstArray(); + + UINT32 i; + for( i = 0 ; i < nPropCount ; i++ ) + { + const Property& rProp = pProps_[ i ]; + + // #58455 Wenn die Property void sein kann, muss als Typ Variant gesetzt werden + SbxDataType eSbxType; + if( rProp.Attributes & PropertyAttribute::MAYBEVOID ) + eSbxType = SbxVARIANT; + else + eSbxType = unoToSbxType( rProp.Type.getTypeClass() ); + + // Property anlegen und reinbraten + SbxVariableRef xVarRef = new SbUnoProperty( rProp.Name, eSbxType, rProp, i, false ); + QuickInsert( (SbxVariable*)xVarRef ); + } + + // Dbg_-Properties anlegen + implCreateDbgProperties(); + + // Methoden anlegen + Sequence< Reference< XIdlMethod > > aMethodSeq = xAccess->getMethods + ( MethodConcept::ALL - MethodConcept::DANGEROUS ); + UINT32 nMethCount = aMethodSeq.getLength(); + const Reference< XIdlMethod >* pMethods_ = aMethodSeq.getConstArray(); + for( i = 0 ; i < nMethCount ; i++ ) + { + // Methode ansprechen + const Reference< XIdlMethod >& rxMethod = pMethods_[i]; + + // SbUnoMethode anlegen und reinbraten + SbxVariableRef xMethRef = new SbUnoMethod + ( rxMethod->getName(), unoToSbxType( rxMethod->getReturnType() ), rxMethod, false ); + QuickInsert( (SbxVariable*)xMethRef ); + } +} + + +// Wert rausgeben +Any SbUnoObject::getUnoAny( void ) +{ + Any aRetAny; + if( bNeedIntrospection ) doIntrospection(); + if( mxMaterialHolder.is() ) + aRetAny = mxMaterialHolder->getMaterial(); + else if( mxInvocation.is() ) + aRetAny <<= mxInvocation; + return aRetAny; +} + +// Hilfsmethode zum Anlegen einer Uno-Struct per CoreReflection +SbUnoObject* Impl_CreateUnoStruct( const String& aClassName ) +{ + // CoreReflection holen + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( !xCoreReflection.is() ) + return NULL; + + // Klasse suchen + Reference< XIdlClass > xClass; + Reference< XHierarchicalNameAccess > xHarryName = + getCoreReflection_HierarchicalNameAccess_Impl(); + if( xHarryName.is() && xHarryName->hasByHierarchicalName( aClassName ) ) + xClass = xCoreReflection->forName( aClassName ); + if( !xClass.is() ) + return NULL; + + // Ist es ueberhaupt ein struct? + TypeClass eType = xClass->getTypeClass(); + if( eType != TypeClass_STRUCT ) + return NULL; + + // Instanz erzeugen + Any aNewAny; + xClass->createObject( aNewAny ); + + // SbUnoObject daraus basteln + SbUnoObject* pUnoObj = new SbUnoObject( aClassName, aNewAny ); + return pUnoObj; +} + + +// Factory-Klasse fuer das Anlegen von Uno-Structs per DIM AS NEW +SbxBase* SbUnoFactory::Create( UINT16, UINT32 ) +{ + // Ueber SbxId laeuft in Uno nix + return NULL; +} + +SbxObject* SbUnoFactory::CreateObject( const String& rClassName ) +{ + return Impl_CreateUnoStruct( rClassName ); +} + +// Funktion, um einen globalen Bezeichner im +// UnoScope zu suchen und fuer Sbx zu wrappen +SbxVariable* findUnoClass( const String& rName ) +{ + // #105550 Check if module exists + SbUnoClass* pUnoClass = NULL; + + Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl(); + Reference< XTypeDescription > xTypeDesc; + if( xTypeAccess->hasByHierarchicalName( rName ) ) + { + Any aRet = xTypeAccess->getByHierarchicalName( rName ); + aRet >>= xTypeDesc; + + if( xTypeDesc.is() ) + { + TypeClass eTypeClass = xTypeDesc->getTypeClass(); + if( eTypeClass == TypeClass_MODULE || eTypeClass == TypeClass_CONSTANTS ) + pUnoClass = new SbUnoClass( rName ); + } + } + return pUnoClass; +} + +SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) +{ + (void)t; + + SbxVariable* pRes = SbxObject::Find( rName, SbxCLASS_VARIABLE ); + + // Wenn nichts gefunden wird, ist das Sub-Modul noch nicht bekannt + if( !pRes ) + { + // Wenn es schon eine Klasse ist, nach einen Feld fragen + if( m_xClass.is() ) + { + // Ist es ein Field + OUString aUStr( rName ); + Reference< XIdlField > xField = m_xClass->getField( aUStr ); + Reference< XIdlClass > xClass; + if( xField.is() ) + { + try + { + Any aAny; + aAny = xField->get( aAny ); + + // Nach Sbx wandeln + pRes = new SbxVariable( SbxVARIANT ); + pRes->SetName( rName ); + unoToSbxValue( pRes, aAny ); + } + catch( BasicErrorException& e0 ) + { + implHandleBasicErrorException( e0 ); + } + catch( WrappedTargetException& e1 ) + { + implHandleWrappedTargetException( e1 ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2 ) ); + } + catch( IllegalArgumentException& e3 ) + { + StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, + implGetExceptionMsg( e3, aIllegalArgumentExceptionName ) ); + } + } + } + else + { + // Vollqualifizierten Namen erweitern + String aNewName = GetName(); + aNewName.AppendAscii( "." ); + aNewName += rName; + + // CoreReflection holen + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( xCoreReflection.is() ) + { + // Ist es eine Konstante? + Reference< XHierarchicalNameAccess > xHarryName( xCoreReflection, UNO_QUERY ); + if( xHarryName.is() ) + { + try + { + Any aValue = xHarryName->getByHierarchicalName( aNewName ); + TypeClass eType = aValue.getValueType().getTypeClass(); + + // Interface gefunden? Dann ist es eine Klasse + if( eType == TypeClass_INTERFACE ) + { + Reference< XInterface > xIface = *(Reference< XInterface >*)aValue.getValue(); + Reference< XIdlClass > xClass( xIface, UNO_QUERY ); + if( xClass.is() ) + { + pRes = new SbxVariable( SbxVARIANT ); + SbxObjectRef xWrapper = (SbxObject*)new SbUnoClass( aNewName, xClass ); + pRes->PutObject( xWrapper ); + + } + } + else + { + pRes = new SbxVariable( SbxVARIANT ); + unoToSbxValue( pRes, aValue ); + } + } + catch( NoSuchElementException& e1 ) + { + String aMsg = implGetExceptionMsg( e1 ); + } + } + + // Sonst wieder als Klasse annehmen + if( !pRes ) + { + SbxVariable* pNewClass = findUnoClass( aNewName ); + if( pNewClass ) + { + Reference< XIdlClass > xClass; + pRes = new SbxVariable( SbxVARIANT ); + SbxObjectRef xWrapper = (SbxObject*)pNewClass; + pRes->PutObject( xWrapper ); + } + } + } + } + + if( pRes ) + { + pRes->SetName( rName ); + + // Variable einfuegen, damit sie spaeter im Find gefunden wird + QuickInsert( pRes ); + + // Uns selbst gleich wieder als Listener rausnehmen, + // die Werte sind alle konstant + if( pRes->IsBroadcaster() ) + EndListening( pRes->GetBroadcaster(), TRUE ); + } + } + return pRes; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/classes/sbxmod.cxx b/bf_basic/source/classes/sbxmod.cxx new file mode 100644 index 00000000000..e66433050e5 --- /dev/null +++ b/bf_basic/source/classes/sbxmod.cxx @@ -0,0 +1,750 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include + +#include +#include +#include +#include "sb.hxx" +#include +#include "sbjsmod.hxx" +#include "sbintern.hxx" +#include "image.hxx" +#include "token.hxx" +#include "sbunoobj.hxx" +#include "basrdll.hxx" + +#include +#include + +// for the bsearch +#ifdef WNT +#define CDECL _cdecl +#endif +#if defined(UNX) +#define CDECL +#endif +#ifdef UNX +#include +#endif + +#include + + +namespace binfilter { + +using ::rtl::OUString; + +TYPEINIT1(SbModule,SbxObject) +TYPEINIT1(SbMethod,SbxMethod) +TYPEINIT1(SbProperty,SbxProperty) +TYPEINIT1(SbProcedureProperty,SbxProperty) +TYPEINIT1(SbJScriptModule,SbModule) +TYPEINIT1(SbJScriptMethod,SbMethod) + +///////////////////////////////////////////////////////////////////////////// + +// Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen +// Elemente von anderen Modulen aus gefunden werden koennen. + +SbModule::SbModule( const String& rName ) + : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASICModule") ) ), + pImage( NULL ), pClassData( NULL ) +{ + SetName( rName ); + SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH ); +} + +SbModule::~SbModule() +{ + if( pImage ) + delete pImage; + if( pClassData ) + delete pClassData; +} + +BOOL SbModule::IsCompiled() const +{ + return BOOL( pImage != 0 ); +} + +const SbxObject* SbModule::FindType( String aTypeName ) const +{ + return pImage ? pImage->FindType( aTypeName ) : NULL; +} + + +// Aus dem Codegenerator: Loeschen des Images und Invalidieren der Entries + +void SbModule::StartDefinitions() +{ + delete pImage; pImage = NULL; + if( pClassData ) + pClassData->clear(); + + // Methoden und Properties bleiben erhalten, sind jedoch ungueltig + // schliesslich sind ja u.U. die Infos belegt + USHORT i; + for( i = 0; i < pMethods->Count(); i++ ) + { + SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) ); + if( p ) + p->bInvalid = TRUE; + } + for( i = 0; i < pProps->Count(); ) + { + SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) ); + if( p ) + pProps->Remove( i ); + else + i++; + } +} + +// Methode anfordern/anlegen + +SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t ) +{ + SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD ); + SbMethod* pMeth = p ? PTR_CAST(SbMethod,p) : NULL; + if( p && !pMeth ) + pMethods->Remove( p ); + if( !pMeth ) + { + pMeth = new SbMethod( rName, t, this ); + pMeth->SetParent( this ); + pMeth->SetFlags( SBX_READ ); + pMethods->Put( pMeth, pMethods->Count() ); + StartListening( pMeth->GetBroadcaster(), TRUE ); + } + // Per Default ist die Methode GUELTIG, da sie auch vom Compiler + // (Codegenerator) erzeugt werden kann + pMeth->bInvalid = FALSE; + pMeth->ResetFlag( SBX_FIXED ); + pMeth->SetFlag( SBX_WRITE ); + pMeth->SetType( t ); + pMeth->ResetFlag( SBX_WRITE ); + if( t != SbxVARIANT ) + pMeth->SetFlag( SBX_FIXED ); + return pMeth; +} + +// Property anfordern/anlegen + +SbIfaceMapperMethod::~SbIfaceMapperMethod() +{ +} + +TYPEINIT1(SbIfaceMapperMethod,SbMethod) + + +// Aus dem Codegenerator: Ungueltige Eintraege entfernen + +void SbModule::EndDefinitions( BOOL bNewState ) +{ + for( USHORT i = 0; i < pMethods->Count(); ) + { + SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) ); + if( p ) + { + if( p->bInvalid ) + pMethods->Remove( p ); + else + { + p->bInvalid = bNewState; + i++; + } + } + else + i++; + } + SetModified( TRUE ); +} + +void SbModule::Clear() +{ + delete pImage; pImage = NULL; + if( pClassData ) + pClassData->clear(); + SbxObject::Clear(); +} + + +SbxVariable* SbModule::Find( const XubString& rName, SbxClassType t ) +{ + SbxVariable* pRes = SbxObject::Find( rName, t ); + return pRes; +} + +const ::rtl::OUString& SbModule::GetSource32() const +{ + return aOUSource; +} + +const String& SbModule::GetSource() const +{ + static String aRetStr; + aRetStr = aOUSource; + return aRetStr; +} + +// Parent und BASIC sind eins! + +void SbModule::SetParent( SbxObject* p ) +{ + pParent = p; +} + +void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbProperty* pProp = PTR_CAST(SbProperty,pVar); + SbMethod* pMeth = PTR_CAST(SbMethod,pVar); + if( pProp ) + { + if( pProp->GetModule() != this ) + SetError( SbxERR_BAD_ACTION ); + } + else if( pMeth ) + { + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + if( pMeth->bInvalid && !Compile() ) + // Auto-Compile hat nicht geklappt! + StarBASIC::Error( SbERR_BAD_PROP_VALUE ); + else + { + // Aufruf eines Unterprogramms + SbModule* pOld = pMOD; + pMOD = this; + Run( (SbMethod*) pVar ); + pMOD = pOld; + } + } + } + else + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + +// Das Setzen der Source macht das Image ungueltig +// und scant die Methoden-Definitionen neu ein + +void SbModule::SetSource( const String& r ) +{ + SetSource32( r ); +} + +void SbModule::SetSource32( const ::rtl::OUString& r ) +{ + aOUSource = r; + StartDefinitions(); + SbiTokenizer aTok( r ); + while( !aTok.IsEof() ) + { + SbiToken eEndTok = NIL; + + // Suchen nach SUB oder FUNCTION + SbiToken eLastTok = NIL; + while( !aTok.IsEof() ) + { + // #32385: Nicht bei declare + SbiToken eCurTok = aTok.Next(); + if( eLastTok != DECLARE ) + { + if( eCurTok == SUB ) + { + eEndTok = ENDSUB; break; + } + if( eCurTok == FUNCTION ) + { + eEndTok = ENDFUNC; break; + } + if( eCurTok == PROPERTY ) + { + eEndTok = ENDPROPERTY; break; + } + if( eCurTok == OPTION ) + { + eCurTok = aTok.Next(); + if( eCurTok == COMPATIBLE ) + aTok.SetCompatible( true ); + } + } + eLastTok = eCurTok; + } + // Definition der Methode + SbMethod* pMeth = NULL; + if( eEndTok != NIL ) + { + USHORT nLine1 = aTok.GetLine(); + if( aTok.Next() == SYMBOL ) + { + String aName_( aTok.GetSym() ); + SbxDataType t = aTok.GetType(); + if( t == SbxVARIANT && eEndTok == ENDSUB ) + t = SbxVOID; + pMeth = GetMethod( aName_, t ); + pMeth->nLine1 = pMeth->nLine2 = nLine1; + // Die Methode ist erst mal GUELTIG + pMeth->bInvalid = FALSE; + } + else + eEndTok = NIL; + } + // Skip bis END SUB/END FUNCTION + if( eEndTok != NIL ) + { + while( !aTok.IsEof() ) + { + if( aTok.Next() == eEndTok ) + { + pMeth->nLine2 = aTok.GetLine(); + break; + } + } + if( aTok.IsEof() ) + pMeth->nLine2 = aTok.GetLine(); + } + } + EndDefinitions( TRUE ); +} + +SbMethod* SbModule::GetFunctionForLine( USHORT nLine ) +{ + for( USHORT i = 0; i < pMethods->Count(); i++ ) + { + SbMethod* p = (SbMethod*) pMethods->Get( i ); + if( p->GetSbxId() == SBXID_BASICMETHOD ) + { + if( nLine >= p->nLine1 && nLine <= p->nLine2 ) + return p; + } + } + return NULL; +} + +// Ausstrahlen eines Hints an alle Basics + +static void _SendHint( SbxObject* pObj, ULONG nId, SbMethod* p ) +{ + // Selbst ein BASIC? + if( pObj->IsA( TYPE(StarBASIC) ) && pObj->IsBroadcaster() ) + pObj->GetBroadcaster().Broadcast( SbxHint( nId, p ) ); + // Dann die Unterobjekte fragen + SbxArray* pObjs = pObj->GetObjects(); + for( USHORT i = 0; i < pObjs->Count(); i++ ) + { + SbxVariable* pVar = pObjs->Get( i ); + if( pVar->IsA( TYPE(SbxObject) ) ) + _SendHint( PTR_CAST(SbxObject,pVar), nId, p ); + } +} + + +// #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden, +// beim Programm-Ende freigeben, damit nichts gehalten wird. +void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic ) +{ + // return-Wert von CreateUnoService loeschen + static String aName( RTL_CONSTASCII_USTRINGPARAM("CreateUnoService") ); + SbxVariable* pVar = pBasic->GetRtl()->Find( aName, SbxCLASS_METHOD ); + if( pVar ) + pVar->SbxValue::Clear(); + + // return-Wert von CreateUnoDialog loeschen + static String aName2( RTL_CONSTASCII_USTRINGPARAM("CreateUnoDialog") ); + pVar = pBasic->GetRtl()->Find( aName2, SbxCLASS_METHOD ); + if( pVar ) + pVar->SbxValue::Clear(); + + // return-Wert von CDec loeschen + static String aName3( RTL_CONSTASCII_USTRINGPARAM("CDec") ); + pVar = pBasic->GetRtl()->Find( aName3, SbxCLASS_METHOD ); + if( pVar ) + pVar->SbxValue::Clear(); + + // return-Wert von CreateObject loeschen + static String aName4( RTL_CONSTASCII_USTRINGPARAM("CreateObject") ); + pVar = pBasic->GetRtl()->Find( aName4, SbxCLASS_METHOD ); + if( pVar ) + pVar->SbxValue::Clear(); + + // Ueber alle Sub-Basics gehen + SbxArray* pObjs = pBasic->GetObjects(); + USHORT nCount = pObjs->Count(); + for( USHORT i = 0 ; i < nCount ; i++ ) + { + SbxVariable* pObjVar = pObjs->Get( i ); + StarBASIC* pSubBasic = PTR_CAST( StarBASIC, pObjVar ); + if( pSubBasic ) + ClearUnoObjectsInRTL_Impl_Rek( pSubBasic ); + } +} + +// Ausfuehren eines BASIC-Unterprogramms +USHORT SbModule::Run( SbMethod* /*pMeth*/ ) +{ + OSL_FAIL( "SbModule::Run: dead code!" ); + return 0; +} + +// Suche nach dem naechsten STMNT-Befehl im Code. Wird vom STMNT- +// Opcode verwendet, um die Endspalte zu setzen. + +const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol ) const +{ + return FindNextStmnt( p, nLine, nCol, FALSE ); +} + +const BYTE* SbModule::FindNextStmnt( const BYTE* /*p*/, USHORT& /*nLine*/, USHORT& /*nCol*/, + BOOL /*bFollowJumps*/, const SbiImage* /*pImg*/ ) const +{ + OSL_FAIL( "SbModule::FindNextStmnt: dead code!" ); + return NULL; +} + +// Testen, ob eine Zeile STMNT-Opcodes enthaelt + +BOOL SbModule::IsBreakable( USHORT nLine ) const +{ + if( !pImage ) + return FALSE; + const BYTE* p = (const BYTE* ) pImage->GetCode(); + USHORT nl, nc; + while( ( p = FindNextStmnt( p, nl, nc ) ) != NULL ) + if( nl == nLine ) + return TRUE; + return FALSE; +} + +USHORT SbModule::GetBPCount() const +{ + return 0; +} + +USHORT SbModule::GetBP( USHORT ) const +{ + return 0; +} + +BOOL SbModule::IsBP( USHORT ) const +{ + return FALSE; +} + +BOOL SbModule::SetBP( USHORT /*nLine*/ ) +{ + OSL_FAIL( "SbModule::SetBP: dead code!" ); + return FALSE; +} + +BOOL SbModule::ClearBP( USHORT ) +{ + return FALSE; +} + +void SbModule::ClearAllBP() +{ +} + +void +SbModule::fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg ) const +{ + if ( !pImg ) + pImg = pImage; + for( UINT32 i = 0; i < pMethods->Count(); i++ ) + { + SbMethod* pMeth = PTR_CAST(SbMethod,pMethods->Get( (USHORT)i ) ); + if( pMeth ) + { + //fixup method start positions + if ( bCvtToLegacy ) + pMeth->nStart = pImg->CalcLegacyOffset( pMeth->nStart ); + else + pMeth->nStart = pImg->CalcNewOffset( (USHORT)pMeth->nStart ); + } + } + +} + +BOOL SbModule::LoadData( SvStream& rStrm, USHORT nVer ) +{ + Clear(); + if( !SbxObject::LoadData( rStrm, 1 ) ) + return FALSE; + // Sicherheitshalber... + SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH ); + BYTE bImage; + rStrm >> bImage; + if( bImage ) + { + SbiImage* p = new SbiImage; + UINT32 nImgVer = 0; + + if( !p->Load( rStrm, nImgVer ) ) + { + delete p; + return FALSE; + } + // If the image is in old format, we fix up the method start offsets + if ( nImgVer < B_EXT_IMG_VERSION ) + { + fixUpMethodStart( false, p ); + p->ReleaseLegacyBuffer(); + } + aComment = p->aComment; + SetName( p->aName ); + if( p->GetCodeSize() ) + { + aOUSource = p->aOUSource; + // Alte Version: Image weg + if( nVer == 1 ) + { + SetSource32( p->aOUSource ); + delete p; + } + else + pImage = p; + } + else + { + SetSource32( p->aOUSource ); + delete p; + } + } + return TRUE; +} + +// Called for >= OO 1.0 passwd protected libraries only +// + +BOOL SbModule::LoadCompleted() +{ + SbxArray* p = GetMethods(); + USHORT i; + for( i = 0; i < p->Count(); i++ ) + { + SbMethod* q = PTR_CAST(SbMethod,p->Get( i ) ); + if( q ) + q->pMod = this; + } + p = GetProperties(); + for( i = 0; i < p->Count(); i++ ) + { + SbProperty* q = PTR_CAST(SbProperty,p->Get( i ) ); + if( q ) + q->pMod = this; + } + return TRUE; +} + + +///////////////////////////////////////////////////////////////////////// +// Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum +// Heraussuchen der Funktionen, spaeter auch zum Syntax-Highlighting verwenden + +// Flags fuer Zeichen-Eigenschaften +#define CHAR_START_IDENTIFIER 0x0001 +#define CHAR_IN_IDENTIFIER 0x0002 +#define CHAR_START_NUMBER 0x0004 +#define CHAR_IN_NUMBER 0x0008 +#define CHAR_IN_HEX_NUMBER 0x0010 +#define CHAR_IN_OCT_NUMBER 0x0020 +#define CHAR_START_STRING 0x0040 +#define CHAR_OPERATOR 0x0080 +#define CHAR_SPACE 0x0100 +#define CHAR_EOL 0x0200 + +#define CHAR_EOF 0x00 + + +///////////////////////////////////////////////////////////////////////// +// Implementation SbJScriptModule (Basic-Modul fuer JavaScript-Sourcen) +SbJScriptModule::SbJScriptModule( const String& rName ) + :SbModule( rName ) +{ +} + +BOOL SbJScriptModule::LoadData( SvStream& rStrm, USHORT nVer ) +{ + (void)nVer; + + Clear(); + if( !SbxObject::LoadData( rStrm, 1 ) ) + return FALSE; + + // Source-String holen + String aTmp; + rStrm.ReadByteString( aTmp, osl_getThreadTextEncoding() ); + aOUSource = aTmp; + return TRUE; +} + +SbMethod::SbMethod( const String& r, SbxDataType t, SbModule* p ) + : SbxMethod( r, t ), pMod( p ) +{ + bInvalid = TRUE; + nStart = + nDebugFlags = + nLine1 = + nLine2 = 0; + // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' + SetFlag( SBX_NO_MODIFY ); +} + +SbMethod::SbMethod( const SbMethod& r ) + : SvRefBase( r ), SbxMethod( r ) +{ + pMod = r.pMod; + bInvalid = r.bInvalid; + nStart = r.nStart; + nDebugFlags = r.nDebugFlags; + nLine1 = r.nLine1; + nLine2 = r.nLine2; + SetFlag( SBX_NO_MODIFY ); +} + +SbMethod::~SbMethod() +{ +} + +BOOL SbMethod::LoadData( SvStream& rStrm, USHORT nVer ) +{ + if( !SbxMethod::LoadData( rStrm, 1 ) ) + return FALSE; + INT16 n; + rStrm >> n; + INT16 nTempStart = (INT16)nStart; + // nDebugFlags = n; // AB 16.1.96: Nicht mehr uebernehmen + if( nVer == 2 ) + rStrm >> nLine1 >> nLine2 >> nTempStart >> bInvalid; + // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' + SetFlag( SBX_NO_MODIFY ); + nStart = nTempStart; + return TRUE; +} + +// Kann spaeter mal weg + +SbxInfo* SbMethod::GetInfo() +{ + return pInfo; +} + +// Schnittstelle zum Ausfuehren einer Methode aus den Applikationen +// #34191# Mit speziellem RefCounting, damit das Basic nicht durch CloseDocument() +// abgeschossen werden kann. Rueckgabewert wird als String geliefert. +ErrCode SbMethod::Call( SbxValue* /*pRet*/ ) +{ + OSL_FAIL( "SbMethod::Call: dead code!" ); + return SbERR_NO_METHOD; +} + + +// #100883 Own Broadcast for SbMethod +void SbMethod::Broadcast( ULONG nHintId ) +{ + if( pCst && !IsSet( SBX_NO_BROADCAST ) && StaticIsEnabledBroadcasting() ) + { + // Da die Methode von aussen aufrufbar ist, hier noch einmal + // die Berechtigung testen + if( nHintId & SBX_HINT_DATAWANTED ) + if( !CanRead() ) + return; + if( nHintId & SBX_HINT_DATACHANGED ) + if( !CanWrite() ) + return; + + if( pMod && !pMod->IsCompiled() ) + pMod->Compile(); + + // Block broadcasts while creating new method + SfxBroadcaster* pSave = pCst; + pCst = NULL; + SbMethod* pThisCopy = new SbMethod( *this ); + SbMethodRef xHolder = pThisCopy; + if( mpPar.Is() ) + { + // this, als Element 0 eintragen, aber den Parent nicht umsetzen! + mpPar->PutDirect( pThisCopy, 0 ); + SetParameters( NULL ); + } + + pCst = pSave; + pSave->Broadcast( SbxHint( nHintId, pThisCopy ) ); + + USHORT nSaveFlags = GetFlags(); + SetFlag( SBX_READWRITE ); + pCst = NULL; + Put( pThisCopy->GetValues_Impl() ); + pCst = pSave; + SetFlags( nSaveFlags ); + } +} + +///////////////////////////////////////////////////////////////////////// + +// Implementation SbJScriptMethod (Method-Klasse als Wrapper fuer JavaScript-Funktionen) + +SbJScriptMethod::SbJScriptMethod( const String& r, SbxDataType t, SbModule* p ) + : SbMethod( r, t, p ) +{ +} + +SbJScriptMethod::~SbJScriptMethod() +{} + + +///////////////////////////////////////////////////////////////////////// + +SbProperty::SbProperty( const String& r, SbxDataType t, SbModule* p ) + : SbxProperty( r, t ), pMod( p ) +{ + bInvalid = FALSE; +} + +SbProperty::~SbProperty() +{} + +///////////////////////////////////////////////////////////////////////// + +SbProcedureProperty::~SbProcedureProperty() +{} + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/comp/buffer.cxx b/bf_basic/source/comp/buffer.cxx new file mode 100644 index 00000000000..b2404d2454e --- /dev/null +++ b/bf_basic/source/comp/buffer.cxx @@ -0,0 +1,172 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "buffer.hxx" +#include + +namespace binfilter { + +const static UINT32 UP_LIMIT=0xFFFFFF00L; + +// Der SbiBuffer wird in Inkrements von mindestens 16 Bytes erweitert. +// Dies ist notwendig, da viele Klassen von einer Pufferlaenge +// von x*16 Bytes ausgehen. + +SbiBuffer::SbiBuffer( SbiParser* p, short n ) +{ + pParser = p; + n = ( (n + 15 ) / 16 ) * 16; + if( !n ) n = 16; + pBuf = NULL; + pCur = NULL; + nInc = n; + nSize = + nOff = 0; +} + +SbiBuffer::~SbiBuffer() +{ + delete[] pBuf; +} + +// Rausreichen des Puffers +// Dies fuehrt zur Loeschung des Puffers! + +char* SbiBuffer::GetBuffer() +{ + char* p = pBuf; + pBuf = NULL; + pCur = NULL; + return p; +} + +// Test, ob der Puffer n Bytes aufnehmen kann. +// Im Zweifelsfall wird er vergroessert + +BOOL SbiBuffer::Check( USHORT n ) +{ + if( !n ) return TRUE; + if( ( static_cast( nOff )+ n ) > static_cast( nSize ) ) + { + if( nInc == 0 ) + return FALSE; + USHORT nn = 0; + while( nn < n ) nn = nn + nInc; + char* p; + if( ( static_cast( nSize ) + nn ) > UP_LIMIT ) p = NULL; + else p = new char [nSize + nn]; + if( !p ) + { + nInc = 0; + delete[] pBuf; pBuf = NULL; + return FALSE; + } + else + { + if( nSize ) memcpy( p, pBuf, nSize ); + delete[] pBuf; + pBuf = p; + pCur = pBuf + nOff; + nSize = nSize + nn; + } + } + return TRUE; +} + +BOOL SbiBuffer::operator +=( INT8 n ) +{ + if( Check( 1 ) ) + { + *pCur++ = (char) n; nOff++; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( UINT8 n ) +{ + if( Check( 1 ) ) + { + *pCur++ = (char) n; nOff++; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( INT16 n ) +{ + if( Check( 2 ) ) + { + *pCur++ = (char) ( n & 0xFF ); + *pCur++ = (char) ( n >> 8 ); + nOff += 2; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( UINT16 n ) +{ + if( Check( 2 ) ) + { + *pCur++ = (char) ( n & 0xFF ); + *pCur++ = (char) ( n >> 8 ); + nOff += 2; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( UINT32 n ) +{ + if( Check( 4 ) ) + { + UINT16 n1 = static_cast( n & 0xFFFF ); + UINT16 n2 = static_cast( n >> 16 ); + if ( operator +=( n1 ) && operator +=( n2 ) ) + return TRUE; + return TRUE; + } + return FALSE; +} + +BOOL SbiBuffer::operator +=( INT32 n ) +{ + return operator +=( (UINT32) n ); +} + + +BOOL SbiBuffer::operator +=( const String& n ) +{ + USHORT l = n.Len() + 1; + if( Check( l ) ) + { + rtl::OString aByteStr(rtl::OUStringToOString(n, osl_getThreadTextEncoding())); + memcpy( pCur, aByteStr.getStr(), l ); + pCur += l; + nOff = nOff + l; + return TRUE; + } + else return FALSE; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/comp/codegen.cxx b/bf_basic/source/comp/codegen.cxx new file mode 100644 index 00000000000..ceddc95ce01 --- /dev/null +++ b/bf_basic/source/comp/codegen.cxx @@ -0,0 +1,230 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sbx.hxx" +#include "image.hxx" +#include "buffer.hxx" +#include "opcodes.hxx" +#include "codegen.hxx" +#include +#include + +namespace binfilter { + +template < class T > +class PCodeVisitor +{ +public: + virtual ~PCodeVisitor(); + + virtual void start( BYTE* pStart ) = 0; + virtual void processOpCode0( SbiOpcode eOp ) = 0; + virtual void processOpCode1( SbiOpcode eOp, T nOp1 ) = 0; + virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 ) = 0; + virtual bool processParams() = 0; + virtual void end() = 0; +}; + +template PCodeVisitor< T >::~PCodeVisitor() +{} + +template +class PCodeBufferWalker +{ +private: + T m_nBytes; + BYTE* m_pCode; + T readParam( BYTE*& pCode ) + { + short nBytes = sizeof( T ); + T nOp1=0; + for ( int i=0; i& visitor ) + { + BYTE* pCode = m_pCode; + if ( !pCode ) + return; + BYTE* pEnd = pCode + m_nBytes; + visitor.start( m_pCode ); + T nOp1 = 0, nOp2 = 0; + for( ; pCode < pEnd; ) + { + SbiOpcode eOp = (SbiOpcode)(*pCode++); + + if ( eOp <= SbOP0_END ) + visitor.processOpCode0( eOp ); + else if( eOp >= SbOP1_START && eOp <= SbOP1_END ) + { + if ( visitor.processParams() ) + nOp1 = readParam( pCode ); + else + pCode += sizeof( T ); + visitor.processOpCode1( eOp, nOp1 ); + } + else if( eOp >= SbOP2_START && eOp <= SbOP2_END ) + { + if ( visitor.processParams() ) + { + nOp1 = readParam( pCode ); + nOp2 = readParam( pCode ); + } + else + pCode += ( sizeof( T ) * 2 ); + visitor.processOpCode2( eOp, nOp1, nOp2 ); + } + } + visitor.end(); + } +}; + +template < class T, class S > +class OffSetAccumulator : public PCodeVisitor< T > +{ + T m_nNumOp0; + T m_nNumSingleParams; + T m_nNumDoubleParams; +public: + + OffSetAccumulator() : m_nNumOp0(0), m_nNumSingleParams(0), m_nNumDoubleParams(0){} + virtual void start( BYTE* /*pStart*/ ){} + virtual void processOpCode0( SbiOpcode /*eOp*/ ){ ++m_nNumOp0; } + virtual void processOpCode1( SbiOpcode /*eOp*/, T /*nOp1*/ ){ ++m_nNumSingleParams; } + virtual void processOpCode2( SbiOpcode /*eOp*/, T /*nOp1*/, T /*nOp2*/ ) { ++m_nNumDoubleParams; } + virtual void end(){} + S offset() + { + T result = 0 ; + static const S max = std::numeric_limits< S >::max(); + result = m_nNumOp0 + ( ( sizeof(S) + 1 ) * m_nNumSingleParams ) + ( (( sizeof(S) * 2 )+ 1 ) * m_nNumDoubleParams ); + return std::min(static_cast(max), result); + } + virtual bool processParams(){ return false; } +}; + +template < class T, class S > +class BufferTransformer : public PCodeVisitor< T > +{ + BYTE* m_pStart; + SbiBuffer m_ConvertedBuf; +public: + BufferTransformer():m_pStart(NULL), m_ConvertedBuf( NULL, 1024 ) {} + virtual void start( BYTE* pStart ){ m_pStart = pStart; } + virtual void processOpCode0( SbiOpcode eOp ) + { + m_ConvertedBuf += (UINT8)eOp; + } + virtual void processOpCode1( SbiOpcode eOp, T nOp1 ) + { + m_ConvertedBuf += (UINT8)eOp; + switch( eOp ) + { + case _JUMP: + case _JUMPT: + case _JUMPF: + case _GOSUB: + case _CASEIS: + case _RETURN: + case _ERRHDL: + case _TESTFOR: + nOp1 = static_cast( convertBufferOffSet(m_pStart, nOp1) ); + break; + case _RESUME: + if ( nOp1 > 1 ) + nOp1 = static_cast( convertBufferOffSet(m_pStart, nOp1) ); + break; + default: + break; // + + } + m_ConvertedBuf += (S)nOp1; + } + virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 ) + { + m_ConvertedBuf += (UINT8)eOp; + if ( eOp == _CASEIS ) + if ( nOp1 ) + nOp1 = static_cast( convertBufferOffSet(m_pStart, nOp1) ); + m_ConvertedBuf += (S)nOp1; + m_ConvertedBuf += (S)nOp2; + + } + virtual bool processParams(){ return true; } + virtual void end() {} + // yeuch, careful here, you can only call + // GetBuffer on the returned SbiBuffer once, also + // you (as the caller) get to own the memory + SbiBuffer& buffer() + { + return m_ConvertedBuf; + } + static S convertBufferOffSet( BYTE* pStart, T nOp1 ) + { + PCodeBufferWalker< T > aBuff( pStart, nOp1); + OffSetAccumulator< T, S > aVisitor; + aBuff.visitBuffer( aVisitor ); + return aVisitor.offset(); + } +}; + +UINT32 +SbiCodeGen::calcNewOffSet( BYTE* pCode, UINT16 nOffset ) +{ + return BufferTransformer< UINT16, UINT32 >::convertBufferOffSet( pCode, nOffset ); +} + +UINT16 +SbiCodeGen::calcLegacyOffSet( BYTE* pCode, UINT32 nOffset ) +{ + return BufferTransformer< UINT32, UINT16 >::convertBufferOffSet( pCode, nOffset ); +} + +template +void +PCodeBuffConvertor::convert() +{ + PCodeBufferWalker< T > aBuf( m_pStart, m_nSize ); + BufferTransformer< T, S > aTrnsfrmer; + aBuf.visitBuffer( aTrnsfrmer ); + m_pCnvtdBuf = (BYTE*)aTrnsfrmer.buffer().GetBuffer(); + m_nCnvtdSize = static_cast( aTrnsfrmer.buffer().GetSize() ); +} + +// instantiate for types needed in SbiImage::Load and SbiImage::Save +template class PCodeBuffConvertor; +template class PCodeBuffConvertor; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/comp/makefile.mk b/bf_basic/source/comp/makefile.mk new file mode 100644 index 00000000000..330af879508 --- /dev/null +++ b/bf_basic/source/comp/makefile.mk @@ -0,0 +1,55 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=binfilter +TARGET=basic_comp + +NO_HIDS=TRUE + +# --- Settings ------------------------------------------------------------ + +.INCLUDE : settings.mk + +INC+= -I$(PRJ)$/inc$/bf_basic + +# --- Allgemein ----------------------------------------------------------- + +EXCEPTIONSFILES= + +SLOFILES= \ + $(EXCEPTIONSFILES) \ + $(SLO)$/codegen.obj \ + $(SLO)$/token.obj \ + $(SLO)$/scanner.obj \ + $(SLO)$/buffer.obj \ + $(SLO)$/sbcomp.obj \ + +# --- Targets -------------------------------------------------------------- + +.INCLUDE : target.mk diff --git a/bf_basic/source/comp/parser.cxx b/bf_basic/source/comp/parser.cxx new file mode 100644 index 00000000000..9a09ed5b0ac --- /dev/null +++ b/bf_basic/source/comp/parser.cxx @@ -0,0 +1,865 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbcomp.hxx" + +struct SbiParseStack { // "Stack" fuer Statement-Blocks + SbiParseStack* pNext; // Chain + SbiExprNode* pWithVar; // Variable fuer WITH + SbiToken eExitTok; // Exit-Token + UINT32 nChain; // JUMP-Chain +}; + +struct SbiStatement { + SbiToken eTok; + void( SbiParser::*Func )(); // Verarbeitungsroutine + BOOL bMain; // TRUE: ausserhalb SUBs OK + BOOL bSubr; // TRUE: in SUBs OK +}; + +#define Y TRUE +#define N FALSE + +static SbiStatement StmntTable [] = { +{ CALL, &SbiParser::Call, N, Y, }, // CALL +{ CLOSE, &SbiParser::Close, N, Y, }, // CLOSE +{ _CONST_, &SbiParser::Dim, Y, Y, }, // CONST +{ DECLARE, &SbiParser::Declare, Y, N, }, // DECLARE +{ DEFBOOL, &SbiParser::DefXXX, Y, N, }, // DEFBOOL +{ DEFCUR, &SbiParser::DefXXX, Y, N, }, // DEFCUR +{ DEFDATE, &SbiParser::DefXXX, Y, N, }, // DEFDATE +{ DEFDBL, &SbiParser::DefXXX, Y, N, }, // DEFDBL +{ DEFERR, &SbiParser::DefXXX, Y, N, }, // DEFERR +{ DEFINT, &SbiParser::DefXXX, Y, N, }, // DEFINT +{ DEFLNG, &SbiParser::DefXXX, Y, N, }, // DEFLNG +{ DEFOBJ, &SbiParser::DefXXX, Y, N, }, // DEFOBJ +{ DEFSNG, &SbiParser::DefXXX, Y, N, }, // DEFSNG +{ DEFSTR, &SbiParser::DefXXX, Y, N, }, // DEFSTR +{ DEFVAR, &SbiParser::DefXXX, Y, N, }, // DEFVAR +{ DIM, &SbiParser::Dim, Y, Y, }, // DIM +{ DO, &SbiParser::DoLoop, N, Y, }, // DO +{ ELSE, &SbiParser::NoIf, N, Y, }, // ELSE +{ ELSEIF, &SbiParser::NoIf, N, Y, }, // ELSEIF +{ ENDIF, &SbiParser::NoIf, N, Y, }, // ENDIF +{ END, &SbiParser::Stop, N, Y, }, // END +{ ENUM, &SbiParser::Enum, Y, N, }, // TYPE +{ ERASE, &SbiParser::Erase, N, Y, }, // ERASE +{ _ERROR_, &SbiParser::ErrorStmnt, N, Y, }, // ERROR +{ EXIT, &SbiParser::Exit, N, Y, }, // EXIT +{ FOR, &SbiParser::For, N, Y, }, // FOR +{ FUNCTION, &SbiParser::SubFunc, Y, N, }, // FUNCTION +{ GOSUB, &SbiParser::Goto, N, Y, }, // GOSUB +{ GLOBAL, &SbiParser::Dim, Y, N, }, // GLOBAL +{ GOTO, &SbiParser::Goto, N, Y, }, // GOTO +{ IF, &SbiParser::If, N, Y, }, // IF +{ IMPLEMENTS, &SbiParser::Implements, Y, N, }, // IMPLEMENTS +{ INPUT, &SbiParser::Input, N, Y, }, // INPUT +{ LET, &SbiParser::Assign, N, Y, }, // LET +{ LINEINPUT,&SbiParser::LineInput, N, Y, }, // LINE INPUT +{ LOOP, &SbiParser::BadBlock, N, Y, }, // LOOP +{ LSET, &SbiParser::LSet, N, Y, }, // LSET +{ NAME, &SbiParser::Name, N, Y, }, // NAME +{ NEXT, &SbiParser::BadBlock, N, Y, }, // NEXT +{ ON, &SbiParser::On, N, Y, }, // ON +{ OPEN, &SbiParser::Open, N, Y, }, // OPEN +{ OPTION, &SbiParser::Option, Y, N, }, // OPTION +{ PRINT, &SbiParser::Print, N, Y, }, // PRINT +{ PRIVATE, &SbiParser::Dim, Y, N, }, // PRIVATE +{ PROPERTY, &SbiParser::SubFunc, Y, N, }, // FUNCTION +{ PUBLIC, &SbiParser::Dim, Y, N, }, // PUBLIC +{ REDIM, &SbiParser::ReDim, N, Y, }, // DIM +{ RESUME, &SbiParser::Resume, N, Y, }, // RESUME +{ RETURN, &SbiParser::Return, N, Y, }, // RETURN +{ RSET, &SbiParser::RSet, N, Y, }, // RSET +{ SELECT, &SbiParser::Select, N, Y, }, // SELECT +{ SET, &SbiParser::Set, N, Y, }, // SET +{ STATIC, &SbiParser::Static, Y, Y, }, // STATIC +{ STOP, &SbiParser::Stop, N, Y, }, // STOP +{ SUB, &SbiParser::SubFunc, Y, N, }, // SUB +{ TYPE, &SbiParser::Type, Y, N, }, // TYPE +{ UNTIL, &SbiParser::BadBlock, N, Y, }, // UNTIL +{ WHILE, &SbiParser::While, N, Y, }, // WHILE +{ WEND, &SbiParser::BadBlock, N, Y, }, // WEND +{ WITH, &SbiParser::With, N, Y, }, // WITH +{ WRITE, &SbiParser::Write, N, Y, }, // WRITE + +{ NIL, NULL, N, N } +}; + + +#ifdef MSC +// 'this' : used in base member initializer list +#pragma warning( disable: 4355 ) +#endif + +SbiParser::SbiParser( StarBASIC* pb, SbModule* pm ) + : SbiTokenizer( pm->GetSource32(), pb ), + aGblStrings( this ), + aLclStrings( this ), + aGlobals( aGblStrings, SbGLOBAL ), + aPublics( aGblStrings, SbPUBLIC ), + aRtlSyms( aGblStrings, SbRTL ), + aGen( *pm, this, 1024 ) +{ + pBasic = pb; + eCurExpr = SbSYMBOL; + eEndTok = NIL; + pProc = NULL; + pStack = NULL; + pWithVar = NULL; + nBase = 0; + bText = + bGblDefs = + bNewGblDefs = + bSingleLineIf = + bExplicit = FALSE; + bClassModule = FALSE; + bVBASupportOn = FALSE; + pPool = &aPublics; + for( short i = 0; i < 26; i++ ) + eDefTypes[ i ] = SbxVARIANT; // Kein expliziter Defaulttyp + + aPublics.SetParent( &aGlobals ); + aGlobals.SetParent( &aRtlSyms ); + + // Die globale Chainkette faengt bei Adresse 0 an: + nGblChain = aGen.Gen( _JUMP, 0 ); + + rTypeArray = new SbxArray; // Array fuer Benutzerdefinierte Typen + rEnumArray = new SbxArray; // Array for Enum types +} + + +// Ist Teil der Runtime-Library? +SbiSymDef* SbiParser::CheckRTLForSym( const String& rSym, SbxDataType eType ) +{ + SbxVariable* pVar = GetBasic()->GetRtl()->Find( rSym, SbxCLASS_DONTCARE ); + SbiSymDef* pDef = NULL; + if( pVar ) + { + if( pVar->IsA( TYPE(SbxMethod) ) ) + { + SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym ); + pProc_->SetType( pVar->GetType() ); + pDef = pProc_; + } + else + { + pDef = aRtlSyms.AddSym( rSym ); + pDef->SetType( eType ); + } + } + return pDef; +} + +// Globale Chainkette schliessen + +BOOL SbiParser::HasGlobalCode() +{ + if( bGblDefs && nGblChain ) + { + aGen.BackChain( nGblChain ); + aGen.Gen( _LEAVE ); + // aGen.Gen( _STOP ); + nGblChain = 0; + } + return bGblDefs; +} + +void SbiParser::OpenBlock( SbiToken eTok, SbiExprNode* pVar ) +{ + SbiParseStack* p = new SbiParseStack; + p->eExitTok = eTok; + p->nChain = 0; + p->pWithVar = pWithVar; + p->pNext = pStack; + pStack = p; + pWithVar = pVar; + + // #29955 for-Schleifen-Ebene pflegen + if( eTok == FOR ) + aGen.IncForLevel(); +} + +void SbiParser::CloseBlock() +{ + if( pStack ) + { + SbiParseStack* p = pStack; + + // #29955 for-Schleifen-Ebene pflegen + if( p->eExitTok == FOR ) + aGen.DecForLevel(); + + aGen.BackChain( p->nChain ); + pStack = p->pNext; + pWithVar = p->pWithVar; + delete p; + } +} + +// EXIT ... + +void SbiParser::Exit() +{ + SbiToken eTok = Next(); + for( SbiParseStack* p = pStack; p; p = p->pNext ) + { + if( eTok == p->eExitTok ) + { + p->nChain = aGen.Gen( _JUMP, p->nChain ); + return; + } + } + if( pStack ) + Error( SbERR_EXPECTED, pStack->eExitTok ); + else + Error( SbERR_BAD_EXIT ); +} + +BOOL SbiParser::TestSymbol( BOOL bKwdOk ) +{ + Peek(); + if( eCurTok == SYMBOL || ( bKwdOk && IsKwd( eCurTok ) ) ) + { + Next(); return TRUE; + } + Error( SbERR_SYMBOL_EXPECTED ); + return FALSE; +} + +// Testen auf ein bestimmtes Token + +BOOL SbiParser::TestToken( SbiToken t ) +{ + if( Peek() == t ) + { + Next(); return TRUE; + } + else + { + Error( SbERR_EXPECTED, t ); + return FALSE; + } +} + +// Testen auf Komma oder EOLN + +BOOL SbiParser::TestComma() +{ + SbiToken eTok = Peek(); + if( IsEoln( eTok ) ) + { + Next(); + return FALSE; + } + else if( eTok != COMMA ) + { + Error( SbERR_EXPECTED, COMMA ); + return FALSE; + } + Next(); + return TRUE; +} + +// Testen, ob EOLN vorliegt + +void SbiParser::TestEoln() +{ + if( !IsEoln( Next() ) ) + { + Error( SbERR_EXPECTED, EOLN ); + while( !IsEoln( Next() ) ) {} + } +} + +// Parsing eines Statement-Blocks +// Das Parsing laeuft bis zum Ende-Token. + +void SbiParser::StmntBlock( SbiToken eEnd ) +{ + SbiToken xe = eEndTok; + eEndTok = eEnd; + while( !bAbort && Parse() ) {} + eEndTok = xe; + if( IsEof() ) + { + Error( SbERR_BAD_BLOCK, eEnd ); + bAbort = TRUE; + } +} + +// Die Hauptroutine. Durch wiederholten Aufrufs dieser Routine wird +// die Quelle geparst. Returnwert FALSE bei Ende/Fehlern. + +BOOL SbiParser::Parse() +{ + if( bAbort ) return FALSE; + + EnableErrors(); + + bErrorIsSymbol = false; + Peek(); + bErrorIsSymbol = true; + // Dateiende? + if( IsEof() ) + { + // AB #33133: Falls keine Sub angelegt wurde, muss hier + // der globale Chain abgeschlossen werden! + // AB #40689: Durch die neue static-Behandlung kann noch + // ein nGblChain vorhanden sein, daher vorher abfragen + if( bNewGblDefs && nGblChain == 0 ) + nGblChain = aGen.Gen( _JUMP, 0 ); + return FALSE; + } + + // Leerstatement? + if( IsEoln( eCurTok ) ) + { + Next(); return TRUE; + } + + if( !bSingleLineIf && MayBeLabel( TRUE ) ) + { + // Ist ein Label + if( !pProc ) + Error( SbERR_NOT_IN_MAIN, aSym ); + else + pProc->GetLabels().Define( aSym ); + Next(); Peek(); + // Leerstatement? + if( IsEoln( eCurTok ) ) + { + Next(); return TRUE; + } + } + + // Ende des Parsings? + if( eCurTok == eEndTok ) + { + Next(); + if( eCurTok != NIL ) + aGen.Statement(); + return FALSE; + } + + // Kommentar? + if( eCurTok == REM ) + { + Next(); return TRUE; + } + + // Kommt ein Symbol, ist es entweder eine Variable( LET ) + // oder eine SUB-Prozedur( CALL ohne Klammern ) + // DOT fuer Zuweisungen im WITH-Block: .A=5 + if( eCurTok == SYMBOL || eCurTok == DOT ) + { + if( !pProc ) + Error( SbERR_EXPECTED, SUB ); + else + { + // Damit Zeile & Spalte stimmen... + Next(); + Push( eCurTok ); + aGen.Statement(); + Symbol(); + } + } + else + { + Next(); + + // Hier folgen nun die Statement-Parser. + + SbiStatement* p; + for( p = StmntTable; p->eTok != NIL; p++ ) + if( p->eTok == eCurTok ) + break; + if( p->eTok != NIL ) + { + if( !pProc && !p->bMain ) + Error( SbERR_NOT_IN_MAIN, eCurTok ); + else if( pProc && !p->bSubr ) + Error( SbERR_NOT_IN_SUBR, eCurTok ); + else + { + // globalen Chain pflegen + // AB #41606/#40689: Durch die neue static-Behandlung kann noch + // ein nGblChain vorhanden sein, daher vorher abfragen + if( bNewGblDefs && nGblChain == 0 && + ( eCurTok == SUB || eCurTok == FUNCTION || eCurTok == PROPERTY ) ) + { + nGblChain = aGen.Gen( _JUMP, 0 ); + bNewGblDefs = FALSE; + } + // Statement-Opcode bitte auch am Anfang einer Sub + if( ( p->bSubr && (eCurTok != STATIC || Peek() == SUB || Peek() == FUNCTION ) ) || + eCurTok == SUB || eCurTok == FUNCTION ) + aGen.Statement(); + (this->*( p->Func ) )(); + SbxError nSbxErr = SbxBase::GetError(); + if( nSbxErr ) + SbxBase::ResetError(), Error( (SbError)nSbxErr ); + } + } + else + Error( SbERR_UNEXPECTED, eCurTok ); + } + + // Test auf Ende des Statements: + // Kann auch ein ELSE sein, da vor dem ELSE kein : stehen muss! + + if( !IsEos() ) + { + Peek(); + if( !IsEos() && eCurTok != ELSE ) + { + // falls das Parsing abgebrochen wurde, bis zum ":" vorgehen: + Error( SbERR_UNEXPECTED, eCurTok ); + while( !IsEos() ) Next(); + } + } + // Der Parser bricht am Ende ab, das naechste Token ist noch nicht + // geholt! + return TRUE; +} + +// Innerste With-Variable liefern +SbiExprNode* SbiParser::GetWithVar() +{ + if( pWithVar ) + return pWithVar; + + // Sonst im Stack suchen + SbiParseStack* p = pStack; + while( p ) + { + // LoopVar kann zur Zeit nur fuer with sein + if( p->pWithVar ) + return p->pWithVar; + p = p->pNext; + } + return NULL; +} + + +// Zuweisung oder Subroutine Call + +void SbiParser::Symbol() +{ + SbiExpression aVar( this, SbSYMBOL ); + + bool bEQ = ( Peek() == EQ ); + RecursiveMode eRecMode = ( bEQ ? PREVENT_CALL : FORCE_CALL ); + bool bSpecialMidHandling = false; + SbiSymDef* pDef = aVar.GetRealVar(); + if( bEQ && pDef && pDef->GetScope() == SbRTL ) + { + String aRtlName = pDef->GetName(); + if( aRtlName.EqualsIgnoreCaseAscii("Mid") ) + { + SbiExprNode* pExprNode = aVar.GetExprNode(); + // SbiNodeType eNodeType; + if( pExprNode && pExprNode->GetNodeType() == SbxVARVAL ) + { + SbiExprList* pPar = pExprNode->GetParameters(); + short nParCount = pPar ? pPar->GetSize() : 0; + if( nParCount == 2 || nParCount == 3 ) + { + if( nParCount == 2 ) + pPar->addExpression( new SbiExpression( this, -1, SbxLONG ) ); + + TestToken( EQ ); + pPar->addExpression( new SbiExpression( this ) ); + + bSpecialMidHandling = true; + } + } + } + } + aVar.Gen( eRecMode ); + if( !bSpecialMidHandling ) + { + if( !bEQ ) + { + aGen.Gen( _GET ); + } + else + { + // Dann muss es eine Zuweisung sein. Was anderes gibts nicht! + if( !aVar.IsLvalue() ) + Error( SbERR_LVALUE_EXPECTED ); + TestToken( EQ ); + SbiExpression aExpr( this ); + aExpr.Gen(); + SbiOpcode eOp = _PUT; + + if( pDef ) + { + if( pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + if( pDef->GetType() == SbxOBJECT ) + { + eOp = _SET; + if( pDef->GetTypeId() ) + { + aGen.Gen( _SETCLASS, pDef->GetTypeId() ); + return; + } + } + } + aGen.Gen( eOp ); + } + } +} + +// Zuweisungen + +void SbiParser::Assign() +{ + SbiExpression aLvalue( this, SbLVALUE ); + TestToken( EQ ); + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + USHORT nLen = 0; + SbiSymDef* pDef = aLvalue.GetRealVar(); + { + if( pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + nLen = aLvalue.GetRealVar()->GetLen(); + } + if( nLen ) + aGen.Gen( _PAD, nLen ); + aGen.Gen( _PUT ); +} + +// Zuweisungen einer Objektvariablen + +void SbiParser::Set() +{ + SbiExpression aLvalue( this, SbLVALUE ); + SbxDataType eType = aLvalue.GetType(); + if( eType != SbxOBJECT && eType != SbxEMPTY && eType != SbxVARIANT ) + Error( SbERR_INVALID_OBJECT ); + TestToken( EQ ); + SbiSymDef* pDef = aLvalue.GetRealVar(); + if( pDef && pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + + SbiToken eTok = Peek(); + if( eTok == NEW ) + { + Next(); + String aStr; + SbiSymDef* pTypeDef = new SbiSymDef( aStr ); + TypeDecl( *pTypeDef, TRUE ); + + aLvalue.Gen(); + aGen.Gen( _CREATE, pDef->GetId(), pTypeDef->GetTypeId() ); + aGen.Gen( _SETCLASS, pDef->GetTypeId() ); + } + else + { + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + // Its a good idea to distinguish between + // set someting = another & + // someting = another + // ( its necessary for vba objects where set is object + // specific and also doesn't involve processing default params ) + if( pDef->GetTypeId() ) + aGen.Gen( _SETCLASS, pDef->GetTypeId() ); + else + { + if ( bVBASupportOn ) + aGen.Gen( _VBASET ); + else + aGen.Gen( _SET ); + } + } +} + + +void SbiParser::LSet() +{ + SbiExpression aLvalue( this, SbLVALUE ); + if( aLvalue.GetType() != SbxSTRING ) + Error( SbERR_INVALID_OBJECT ); + TestToken( EQ ); + SbiSymDef* pDef = aLvalue.GetRealVar(); + if( pDef && pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + aGen.Gen( _LSET ); +} + + +void SbiParser::RSet() +{ + SbiExpression aLvalue( this, SbLVALUE ); + if( aLvalue.GetType() != SbxSTRING ) + Error( SbERR_INVALID_OBJECT ); + TestToken( EQ ); + SbiSymDef* pDef = aLvalue.GetRealVar(); + if( pDef && pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + aGen.Gen( _RSET ); +} + +// DEFINT, DEFLNG, DEFSNG, DEFDBL, DEFSTR und so weiter + +void SbiParser::DefXXX() +{ + sal_Unicode ch1, ch2; + SbxDataType t = SbxDataType( eCurTok - DEFINT + SbxINTEGER ); + + while( !bAbort ) + { + if( Next() != SYMBOL ) break; + ch1 = aSym.ToUpperAscii().GetBuffer()[0]; + ch2 = 0; + if( Peek() == MINUS ) + { + Next(); + if( Next() != SYMBOL ) Error( SbERR_SYMBOL_EXPECTED ); + else + { + ch2 = aSym.ToUpperAscii().GetBuffer()[0]; + if( ch2 < ch1 ) Error( SbERR_SYNTAX ), ch2 = 0; + } + } + if (!ch2) ch2 = ch1; + ch1 -= 'A'; ch2 -= 'A'; + for (; ch1 <= ch2; ch1++) eDefTypes[ ch1 ] = t; + if( !TestComma() ) break; + } +} + +// STOP/SYSTEM + +void SbiParser::Stop() +{ + aGen.Gen( _STOP ); + Peek(); // #35694: Nur Peek(), damit EOL in Single-Line-If erkannt wird +} + +// IMPLEMENTS + +void SbiParser::Implements() +{ + if( !bClassModule ) + { + Error( SbERR_UNEXPECTED, IMPLEMENTS ); + return; + } + + if( TestSymbol() ) + { + String aImplementedIface = GetSym(); + aIfaceVector.push_back( aImplementedIface ); + } +} + +void SbiParser::EnableCompatibility() +{ + if( !bCompatible ) + AddConstants(); + bCompatible = TRUE; +} + +// OPTION + +void SbiParser::Option() +{ + switch( Next() ) + { + case EXPLICIT: + bExplicit = TRUE; break; + case BASE: + if( Next() == NUMBER ) + { + if( nVal == 0 || nVal == 1 ) + { + nBase = (short) nVal; + break; + } + } + Error( SbERR_EXPECTED, "0/1" ); + break; + case PRIVATE: + { + String aString = SbiTokenizer::Symbol(Next()); + if( !aString.EqualsIgnoreCaseAscii("Module") ) + Error( SbERR_EXPECTED, "Module" ); + break; + } + case COMPARE: + switch( Next() ) + { + case TEXT: bText = TRUE; return; + case BINARY: bText = FALSE; return; + default:; + } // Fall thru! + case COMPATIBLE: + EnableCompatibility(); + break; + + case CLASSMODULE: + bClassModule = TRUE; + break; + case VBASUPPORT: + if( Next() == NUMBER ) + { + if ( nVal == 1 || nVal == 0 ) + { + bVBASupportOn = ( nVal == 1 ); + if ( bVBASupportOn ) + EnableCompatibility(); + break; + } + } + Error( SbERR_EXPECTED, "0/1" ); + break; + default: + Error( SbERR_BAD_OPTION, eCurTok ); + } +} + +void addStringConst( SbiSymPool& rPool, const char* pSym, const String& rStr ) +{ + SbiConstDef* pConst = new SbiConstDef( String::CreateFromAscii( pSym ) ); + pConst->SetType( SbxSTRING ); + pConst->Set( rStr ); + rPool.Add( pConst ); +} + +inline void addStringConst( SbiSymPool& rPool, const char* pSym, const char* pStr ) +{ + addStringConst( rPool, pSym, String::CreateFromAscii( pStr ) ); +} + +void SbiParser::AddConstants( void ) +{ + // #113063 Create constant RTL symbols + addStringConst( aPublics, "vbCr", "\x0D" ); + addStringConst( aPublics, "vbCrLf", "\x0D\x0A" ); + addStringConst( aPublics, "vbFormFeed", "\x0C" ); + addStringConst( aPublics, "vbLf", "\x0A" ); +#if defined(UNX) + addStringConst( aPublics, "vbNewLine", "\x0A" ); +#else + addStringConst( aPublics, "vbNewLine", "\x0D\x0A" ); +#endif + addStringConst( aPublics, "vbNullString", "" ); + addStringConst( aPublics, "vbTab", "\x09" ); + addStringConst( aPublics, "vbVerticalTab", "\x0B" ); + + // Force length 1 and make char 0 afterwards + String aNullCharStr( String::CreateFromAscii( " " ) ); + aNullCharStr.SetChar( 0, 0 ); + addStringConst( aPublics, "vbNullChar", aNullCharStr ); +} + +// ERROR n + +void SbiParser::ErrorStmnt() +{ + SbiExpression aPar( this ); + aPar.Gen(); + aGen.Gen( _ERROR ); +} + + +// JavaScript-Parsing zunaechst provisorisch hier implementiert +void SbiParser::OpenJavaBlock( SbiToken, SbiExprNode* ) +{ +} + +void SbiParser::CloseJavaBlock() +{ +} + +void SbiParser::JavaStmntBlock( SbiToken ) +{ +} + +void SbiParser::JavaBreak() +{ +} + +void SbiParser::JavaContinue() +{ +} + +void SbiParser::JavaFor() +{ +} + +void SbiParser::JavaFunction() +{ +} + +void SbiParser::JavaIf() +{ +} + +void SbiParser::JavaNew() +{ +} + +void SbiParser::JavaReturn() +{ +} + +void SbiParser::JavaThis() +{ +} + +void SbiParser::JavaVar() +{ +} + +void SbiParser::JavaWhile() +{ +} + +void SbiParser::JavaWith() +{ +} + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/comp/sbcomp.cxx b/bf_basic/source/comp/sbcomp.cxx new file mode 100644 index 00000000000..ed6c03ccf2f --- /dev/null +++ b/bf_basic/source/comp/sbcomp.cxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sbx.hxx" +#include "image.hxx" + + + +#include + +#include +#include +#include +#include + +namespace binfilter { + +// Diese Routine ist hier definiert, damit der Compiler als eigenes Segment +// geladen werden kann. + +BOOL SbModule::Compile() +{ + OSL_FAIL( "SbModule::Compile: dead code!" ); + return FALSE; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/comp/scanner.cxx b/bf_basic/source/comp/scanner.cxx new file mode 100644 index 00000000000..366d979b862 --- /dev/null +++ b/bf_basic/source/comp/scanner.cxx @@ -0,0 +1,538 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "scanner.hxx" +#include "sbintern.hxx" +#include "token.hxx" +#include +#include +#include +#if defined UNX +#include +#else +#include // atof() +#endif +#include +#include +#include + +namespace binfilter { + +SbiScanner::SbiScanner( const ::rtl::OUString& rBuf, StarBASIC* p ) : aBuf( rBuf ) +{ + pBasic = p; + pLine = NULL; + nVal = 0; + eScanType = SbxVARIANT; + nErrors = 0; + nBufPos = 0; + nCurCol1 = 0; + nSavedCol1 = 0; + nColLock = 0; + nLine = 0; + nCol1 = 0; + nCol2 = 0; + nCol = 0; + bError = + bAbort = + bSpaces = + bNumber = + bSymbol = + bUsedForHilite = + bCompatible = + bPrevLineExtentsComment = FALSE; + bHash = + bErrors = TRUE; +} + +SbiScanner::~SbiScanner() +{} + + +void SbiScanner::GenError( SbError code ) +{ + if( GetSbData()->bBlockCompilerError ) + { + bAbort = TRUE; + return; + } + if( !bError && bErrors ) + { + BOOL bRes = TRUE; + // Nur einen Fehler pro Statement reporten + bError = TRUE; + if( pBasic ) + { + // Falls EXPECTED oder UNEXPECTED kommen sollte, bezieht es sich + // immer auf das letzte Token, also die Col1 uebernehmen + USHORT nc = nColLock ? nSavedCol1 : nCol1; + switch( code ) + { + case SbERR_EXPECTED: + case SbERR_UNEXPECTED: + case SbERR_SYMBOL_EXPECTED: + case SbERR_LABEL_EXPECTED: + nc = nCol1; + if( nc > nCol2 ) nCol2 = nc; + break; + } + bRes = pBasic->CError( code, aError, nLine, nc, nCol2 ); + } + bAbort |= !bRes | + ( code == SbERR_NO_MEMORY || code == SbERR_PROG_TOO_LARGE ); + } + if( bErrors ) + nErrors++; +} + +// Testen auf ein legales Suffix + +static SbxDataType GetSuffixType( sal_Unicode c ) +{ + static String aSuffixesStr = String::CreateFromAscii( "%&!#@ $" ); + if( c ) + { + sal_uInt32 n = aSuffixesStr.Search( c ); + if( STRING_NOTFOUND != n && c != ' ' ) + return SbxDataType( (USHORT) n + SbxINTEGER ); + } + return SbxVARIANT; +} + +// Einlesen des naechsten Symbols in die Variablen aSym, nVal und eType +// Returnwert ist FALSE bei EOF oder Fehlern +#define BUF_SIZE 80 + +BOOL SbiScanner::NextSym() +{ + // Fuer den EOLN-Fall merken + USHORT nOldLine = nLine; + USHORT nOldCol1 = nCol1; + USHORT nOldCol2 = nCol2; + sal_Unicode buf[ BUF_SIZE ], *p = buf; + bHash = FALSE; + + eScanType = SbxVARIANT; + aSym.Erase(); + bSymbol = + bNumber = bSpaces = FALSE; + + // Zeile einlesen? + if( !pLine ) + { + INT32 n = nBufPos; + INT32 nLen = aBuf.getLength(); + if( nBufPos >= nLen ) + return FALSE; + const sal_Unicode* p2 = aBuf.getStr(); + p2 += n; + while( ( n < nLen ) && ( *p2 != '\n' ) && ( *p2 != '\r' ) ) + p2++, n++; + aLine = aBuf.copy( nBufPos, n - nBufPos ); + if( n < nLen ) + { + if( *p2 == '\r' && *( p2+1 ) == '\n' ) + n += 2; + else + n++; + } + nBufPos = n; + pLine = aLine.getStr(); + nOldLine = ++nLine; + nCol = nCol1 = nCol2 = nOldCol1 = nOldCol2 = 0; + nColLock = 0; + } + + // Leerstellen weg: + while( *pLine && (( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' )) ) + pLine++, nCol++, bSpaces = TRUE; + + nCol1 = nCol; + + // nur Leerzeile? + if( !*pLine ) + goto eoln; + + if( bPrevLineExtentsComment ) + goto PrevLineCommentLbl; + + if( *pLine == '#' ) + { + pLine++; + nCol++; + bHash = TRUE; + } + + // Symbol? Dann Zeichen kopieren. + if( BasicSimpleCharClass::isAlpha( *pLine, bCompatible ) || *pLine == '_' ) + { + // Wenn nach '_' nichts kommt, ist es ein Zeilenabschluss! + if( *pLine == '_' && !*(pLine+1) ) + { pLine++; + goto eoln; } + bSymbol = TRUE; + short n = nCol; + for ( ; (BasicSimpleCharClass::isAlphaNumeric( *pLine, bCompatible ) || ( *pLine == '_' ) ); pLine++ ) + nCol++; + aSym = aLine.copy( n, nCol - n ); + // Abschliessendes '_' durch Space ersetzen, wenn Zeilenende folgt + // (sonst falsche Zeilenfortsetzung) + if( !bUsedForHilite && !*pLine && *(pLine-1) == '_' ) + { + aSym.GetBufferAccess(); // #109693 force copy if necessary + *((sal_Unicode*)(pLine-1)) = ' '; // cast wegen const + } + // Typkennung? + // Das Ausrufezeichen bitte nicht testen, wenn + // danach noch ein Symbol anschliesst + else if( *pLine != '!' || !BasicSimpleCharClass::isAlpha( pLine[ 1 ], bCompatible ) ) + { + SbxDataType t = GetSuffixType( *pLine ); + if( t != SbxVARIANT ) + { + eScanType = t; + pLine++; + nCol++; + } + } + } + + // Zahl? Dann einlesen und konvertieren. + else if( BasicSimpleCharClass::isDigit( *pLine & 0xFF ) + || ( *pLine == '.' && BasicSimpleCharClass::isDigit( *(pLine+1) & 0xFF ) ) ) + { + short exp = 0; + short comma = 0; + short ndig = 0; + short ncdig = 0; + eScanType = SbxDOUBLE; + BOOL bBufOverflow = FALSE; + while( strchr( "0123456789.DEde", *pLine ) && *pLine ) + { + // Buffer full? Stop scanning + if( (p-buf) == (BUF_SIZE-1) ) + { + bBufOverflow = TRUE; + pLine++, nCol++; + continue; + } + // Komma oder Exponent? + if( *pLine == '.' ) + { + if( ++comma > 1 ) + { + pLine++; nCol++; continue; + } + else *p++ = *pLine++, nCol++; + } + else if( strchr( "DdEe", *pLine ) ) + { + if (++exp > 1) + { + pLine++; nCol++; continue; + } + *p++ = 'E'; pLine++; nCol++; + // Vorzeichen hinter Exponent? + if( *pLine == '+' ) + pLine++, nCol++; + else + if( *pLine == '-' ) + *p++ = *pLine++, nCol++; + } + else + { + *p++ = *pLine++, nCol++; + if( comma && !exp ) ncdig++; + } + if (!exp) ndig++; + } + *p = 0; + aSym = p; bNumber = TRUE; + // Komma, Exponent mehrfach vorhanden? + if( comma > 1 || exp > 1 ) + { aError = '.'; + GenError( SbERR_BAD_CHAR_IN_NUMBER ); } + + // #57844 Lokalisierte Funktion benutzen + nVal = rtl_math_uStringToDouble( buf, buf+(p-buf), '.', ',', NULL, NULL ); + // ALT: nVal = atof( buf ); + + ndig = ndig - comma; + if( !comma && !exp ) + { + if( nVal >= SbxMININT && nVal <= SbxMAXINT ) + eScanType = SbxINTEGER; + else + if( nVal >= SbxMINLNG && nVal <= SbxMAXLNG ) + eScanType = SbxLONG; + } + if( bBufOverflow ) + GenError( SbERR_MATH_OVERFLOW ); + + // Typkennung? + SbxDataType t = GetSuffixType( *pLine ); + if( t != SbxVARIANT ) + { + eScanType = t; + pLine++; + nCol++; + } + } + + // Hex/Oktalzahl? Einlesen und konvertieren: + else if( *pLine == '&' ) + { + pLine++; nCol++; + sal_Unicode cmp1[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F', 0 }; + sal_Unicode cmp2[] = { '0', '1', '2', '3', '4', '5', '6', '7', 0 }; + sal_Unicode *cmp = cmp1; + sal_Unicode base = 16; + sal_Unicode ndig = 8; + sal_Unicode xch = *pLine++ & 0xFF; nCol++; + switch( toupper( xch ) ) + { + case 'O': + cmp = cmp2; base = 8; ndig = 11; break; + case 'H': + break; + default : + // Wird als Operator angesehen + pLine--; nCol--; nCol1 = nCol-1; aSym = '&'; return SYMBOL; + } + bNumber = TRUE; + long l = 0; + int i; + BOOL bBufOverflow = FALSE; + while( BasicSimpleCharClass::isAlphaNumeric( *pLine & 0xFF, bCompatible ) ) + { + sal_Unicode ch = sal::static_int_cast< sal_Unicode >( + toupper( *pLine & 0xFF ) ); + pLine++; nCol++; + + // If buffer full, stop scanning. + if( (p-buf) == (BUF_SIZE-1) ) + bBufOverflow = TRUE; + else if( String( cmp ).Search( ch ) != STRING_NOTFOUND ) + *p++ = ch; + else + { + aError = ch; + GenError( SbERR_BAD_CHAR_IN_NUMBER ); + } + } + *p = 0; + for( p = buf; *p; p++ ) + { + i = (*p & 0xFF) - '0'; + if( i > 9 ) i -= 7; + l = ( l * base ) + i; + if( !ndig-- ) + { + GenError( SbERR_MATH_OVERFLOW ); break; + } + } + if( *pLine == '&' ) pLine++, nCol++; + nVal = (double) l; + eScanType = ( l >= SbxMININT && l <= SbxMAXINT ) ? SbxINTEGER : SbxLONG; + if( bBufOverflow ) + GenError( SbERR_MATH_OVERFLOW ); + } + + // Strings: + else if( *pLine == '"' || *pLine == '[' ) + { + sal_Unicode cSep = *pLine; + if( cSep == '[' ) + bSymbol = TRUE, cSep = ']'; + short n = nCol+1; + while( *pLine ) + { + do pLine++, nCol++; + while( *pLine && ( *pLine != cSep ) ); + if( *pLine == cSep ) + { + pLine++; nCol++; + if( *pLine != cSep || cSep == ']' ) break; + } else aError = cSep, GenError( SbERR_EXPECTED ); + } + aSym = aLine.copy( n, nCol - n - 1 ); + // Doppelte Stringbegrenzer raus + String s( cSep ); + s += cSep; + USHORT nIdx = 0; + do + { + nIdx = aSym.Search( s, nIdx ); + if( nIdx == STRING_NOTFOUND ) + break; + aSym.Erase( nIdx, 1 ); + nIdx++; + } + while( true ); + if( cSep != ']' ) + eScanType = ( cSep == '#' ) ? SbxDATE : SbxSTRING; + } + // ungueltige Zeichen: + else if( ( *pLine & 0xFF ) >= 0x7F ) + { + GenError( SbERR_SYNTAX ); pLine++; nCol++; + } + // andere Gruppen: + else + { + short n = 1; + switch( *pLine++ ) + { + case '<': if( *pLine == '>' || *pLine == '=' ) n = 2; break; + case '>': if( *pLine == '=' ) n = 2; break; + case ':': if( *pLine == '=' ) n = 2; break; + } + aSym = aLine.copy( nCol, n ); + pLine += n-1; nCol = nCol + n; + } + + nCol2 = nCol-1; + +PrevLineCommentLbl: + // Kommentar? + if( bPrevLineExtentsComment || (eScanType != SbxSTRING && + ( aSym.GetBuffer()[0] == '\'' || aSym.EqualsIgnoreCaseAscii( "REM" ) ) ) ) + { + bPrevLineExtentsComment = FALSE; + aSym = String::CreateFromAscii( "REM" ); + USHORT nLen = String( pLine ).Len(); + if( bCompatible && pLine[ nLen - 1 ] == '_' && pLine[ nLen - 2 ] == ' ' ) + bPrevLineExtentsComment = TRUE; + nCol2 = nCol2 + nLen; + pLine = NULL; + } + return TRUE; + + // Sonst Zeilen-Ende: aber bitte auf '_' testen, ob die + // Zeile nicht weitergeht! +eoln: + if( nCol && *--pLine == '_' ) + { + pLine = NULL; return NextSym(); + } + else + { + pLine = NULL; + nLine = nOldLine; + nCol1 = nOldCol1; + nCol2 = nOldCol2; + aSym = '\n'; + nColLock = 0; + return TRUE; + } +} + +LetterTable BasicSimpleCharClass::aLetterTable; + +LetterTable::LetterTable( void ) +{ + for( int i = 0 ; i < 256 ; ++i ) + IsLetterTab[i] = false; + + IsLetterTab[0xC0] = true; // À , CAPITAL LETTER A WITH GRAVE ACCENT + IsLetterTab[0xC1] = true; // Á , CAPITAL LETTER A WITH ACUTE ACCENT + IsLetterTab[0xC2] = true; // Â , CAPITAL LETTER A WITH CIRCUMFLEX ACCENT + IsLetterTab[0xC3] = true; // Ã , CAPITAL LETTER A WITH TILDE + IsLetterTab[0xC4] = true; // Ä , CAPITAL LETTER A WITH DIAERESIS + IsLetterTab[0xC5] = true; // Å , CAPITAL LETTER A WITH RING ABOVE + IsLetterTab[0xC6] = true; // Æ , CAPITAL LIGATURE AE + IsLetterTab[0xC7] = true; // Ç , CAPITAL LETTER C WITH CEDILLA + IsLetterTab[0xC8] = true; // È , CAPITAL LETTER E WITH GRAVE ACCENT + IsLetterTab[0xC9] = true; // É , CAPITAL LETTER E WITH ACUTE ACCENT + IsLetterTab[0xCA] = true; // Ê , CAPITAL LETTER E WITH CIRCUMFLEX ACCENT + IsLetterTab[0xCB] = true; // Ë , CAPITAL LETTER E WITH DIAERESIS + IsLetterTab[0xCC] = true; // Ì , CAPITAL LETTER I WITH GRAVE ACCENT + IsLetterTab[0xCD] = true; // Í , CAPITAL LETTER I WITH ACUTE ACCENT + IsLetterTab[0xCE] = true; // Î , CAPITAL LETTER I WITH CIRCUMFLEX ACCENT + IsLetterTab[0xCF] = true; // Ï , CAPITAL LETTER I WITH DIAERESIS + IsLetterTab[0xD0] = true; // Ð , CAPITAL LETTER ETH + IsLetterTab[0xD1] = true; // Ñ , CAPITAL LETTER N WITH TILDE + IsLetterTab[0xD2] = true; // Ò , CAPITAL LETTER O WITH GRAVE ACCENT + IsLetterTab[0xD3] = true; // Ó , CAPITAL LETTER O WITH ACUTE ACCENT + IsLetterTab[0xD4] = true; // Ô , CAPITAL LETTER O WITH CIRCUMFLEX ACCENT + IsLetterTab[0xD5] = true; // Õ , CAPITAL LETTER O WITH TILDE + IsLetterTab[0xD6] = true; // Ö , CAPITAL LETTER O WITH DIAERESIS + IsLetterTab[0xD8] = true; // Ø , CAPITAL LETTER O WITH STROKE + IsLetterTab[0xD9] = true; // Ù , CAPITAL LETTER U WITH GRAVE ACCENT + IsLetterTab[0xDA] = true; // Ú , CAPITAL LETTER U WITH ACUTE ACCENT + IsLetterTab[0xDB] = true; // Û , CAPITAL LETTER U WITH CIRCUMFLEX ACCENT + IsLetterTab[0xDC] = true; // Ü , CAPITAL LETTER U WITH DIAERESIS + IsLetterTab[0xDD] = true; // Ý , CAPITAL LETTER Y WITH ACUTE ACCENT + IsLetterTab[0xDE] = true; // Þ , CAPITAL LETTER THORN + IsLetterTab[0xDF] = true; // ß , SMALL LETTER SHARP S + IsLetterTab[0xE0] = true; // à , SMALL LETTER A WITH GRAVE ACCENT + IsLetterTab[0xE1] = true; // á , SMALL LETTER A WITH ACUTE ACCENT + IsLetterTab[0xE2] = true; // â , SMALL LETTER A WITH CIRCUMFLEX ACCENT + IsLetterTab[0xE3] = true; // ã , SMALL LETTER A WITH TILDE + IsLetterTab[0xE4] = true; // ä , SMALL LETTER A WITH DIAERESIS + IsLetterTab[0xE5] = true; // å , SMALL LETTER A WITH RING ABOVE + IsLetterTab[0xE6] = true; // æ , SMALL LIGATURE AE + IsLetterTab[0xE7] = true; // ç , SMALL LETTER C WITH CEDILLA + IsLetterTab[0xE8] = true; // è , SMALL LETTER E WITH GRAVE ACCENT + IsLetterTab[0xE9] = true; // é , SMALL LETTER E WITH ACUTE ACCENT + IsLetterTab[0xEA] = true; // ê , SMALL LETTER E WITH CIRCUMFLEX ACCENT + IsLetterTab[0xEB] = true; // ë , SMALL LETTER E WITH DIAERESIS + IsLetterTab[0xEC] = true; // ì , SMALL LETTER I WITH GRAVE ACCENT + IsLetterTab[0xED] = true; // í , SMALL LETTER I WITH ACUTE ACCENT + IsLetterTab[0xEE] = true; // î , SMALL LETTER I WITH CIRCUMFLEX ACCENT + IsLetterTab[0xEF] = true; // ï , SMALL LETTER I WITH DIAERESIS + IsLetterTab[0xF0] = true; // ð , SMALL LETTER ETH + IsLetterTab[0xF1] = true; // ñ , SMALL LETTER N WITH TILDE + IsLetterTab[0xF2] = true; // ò , SMALL LETTER O WITH GRAVE ACCENT + IsLetterTab[0xF3] = true; // ó , SMALL LETTER O WITH ACUTE ACCENT + IsLetterTab[0xF4] = true; // ô , SMALL LETTER O WITH CIRCUMFLEX ACCENT + IsLetterTab[0xF5] = true; // õ , SMALL LETTER O WITH TILDE + IsLetterTab[0xF6] = true; // ö , SMALL LETTER O WITH DIAERESIS + IsLetterTab[0xF8] = true; // ø , SMALL LETTER O WITH OBLIQUE BAR + IsLetterTab[0xF9] = true; // ù , SMALL LETTER U WITH GRAVE ACCENT + IsLetterTab[0xFA] = true; // ú , SMALL LETTER U WITH ACUTE ACCENT + IsLetterTab[0xFB] = true; // û , SMALL LETTER U WITH CIRCUMFLEX ACCENT + IsLetterTab[0xFC] = true; // ü , SMALL LETTER U WITH DIAERESIS + IsLetterTab[0xFD] = true; // ý , SMALL LETTER Y WITH ACUTE ACCENT + IsLetterTab[0xFE] = true; // þ , SMALL LETTER THORN + IsLetterTab[0xFF] = true; // ÿ , SMALL LETTER Y WITH DIAERESIS +} + +bool LetterTable::isLetterUnicode( sal_Unicode c ) +{ + static CharClass* pCharClass = NULL; + if( pCharClass == NULL ) + pCharClass = new CharClass( Application::GetSettings().GetLocale() ); + String aStr( c ); + bool bRet = pCharClass->isLetter( aStr, 0 ); + return bRet; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/comp/token.cxx b/bf_basic/source/comp/token.cxx new file mode 100644 index 00000000000..d7088c16926 --- /dev/null +++ b/bf_basic/source/comp/token.cxx @@ -0,0 +1,410 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "token.hxx" + +namespace binfilter { + +struct TokenTable { SbiToken t; const char *s; }; + +static short nToken; // Anzahl der Tokens + +static TokenTable* pTokTable; + +static TokenTable aTokTable_Basic [] = { // Token-Tabelle: + + { CAT, "&" }, + { MUL, "*" }, + { PLUS, "+" }, + { MINUS, "-" }, + { DIV, "/" }, + { EOS, ":" }, + { ASSIGN, ":=" }, + { LT, "<" }, + { LE, "<=" }, + { NE, "<>" }, + { EQ, "=" }, + { GT, ">" }, + { GE, ">=" }, + { ACCESS, "Access" }, + { ALIAS, "Alias" }, + { AND, "And" }, + { ANY, "Any" }, + { APPEND, "Append" }, + { AS, "As" }, + { BASE, "Base" }, + { BINARY, "Binary" }, + { TBOOLEAN, "Boolean" }, + { BYREF, "ByRef", }, + { TBYTE, "Byte", }, + { BYVAL, "ByVal", }, + { CALL, "Call" }, + { CASE, "Case" }, + { _CDECL_, "Cdecl" }, + { CLASSMODULE, "ClassModule" }, + { CLOSE, "Close" }, + { COMPARE, "Compare" }, + { COMPATIBLE,"Compatible" }, + { _CONST_, "Const" }, + { TCURRENCY,"Currency" }, + { TDATE, "Date" }, + { DECLARE, "Declare" }, + { DEFBOOL, "DefBool" }, + { DEFCUR, "DefCur" }, + { DEFDATE, "DefDate" }, + { DEFDBL, "DefDbl" }, + { DEFERR, "DefErr" }, + { DEFINT, "DefInt" }, + { DEFLNG, "DefLng" }, + { DEFOBJ, "DefObj" }, + { DEFSNG, "DefSng" }, + { DEFSTR, "DefStr" }, + { DEFVAR, "DefVar" }, + { DIM, "Dim" }, + { DO, "Do" }, + { TDOUBLE, "Double" }, + { EACH, "Each" }, + { ELSE, "Else" }, + { ELSEIF, "ElseIf" }, + { END, "End" }, + { ENDENUM, "End Enum" }, + { ENDFUNC, "End Function" }, + { ENDIF, "End If" }, + { ENDPROPERTY, "End Property" }, + { ENDSELECT,"End Select" }, + { ENDSUB, "End Sub" }, + { ENDTYPE, "End Type" }, + { ENDIF, "EndIf" }, + { ENUM, "Enum" }, + { EQV, "Eqv" }, + { ERASE, "Erase" }, + { _ERROR_, "Error" }, + { EXIT, "Exit" }, + { EXPLICIT, "Explicit" }, + { FOR, "For" }, + { FUNCTION, "Function" }, + { GET, "Get" }, + { GLOBAL, "Global" }, + { GOSUB, "GoSub" }, + { GOTO, "GoTo" }, + { IF, "If" }, + { IMP, "Imp" }, + { IMPLEMENTS, "Implements" }, + { _IN_, "In" }, + { INPUT, "Input" }, // auch INPUT # + { TINTEGER, "Integer" }, + { IS, "Is" }, + { LET, "Let" }, + { LIB, "Lib" }, + { LINE, "Line" }, + { LINEINPUT,"Line Input" }, + { LOCAL, "Local" }, + { LOCK, "Lock" }, + { TLONG, "Long" }, + { LOOP, "Loop" }, + { LPRINT, "LPrint" }, + { LSET, "LSet" }, // JSM + { MOD, "Mod" }, + { NAME, "Name" }, + { NEW, "New" }, + { NEXT, "Next" }, + { NOT, "Not" }, + { TOBJECT, "Object" }, + { ON, "On" }, + { OPEN, "Open" }, + { OPTION, "Option" }, + { _OPTIONAL_, "Optional" }, + { OR, "Or" }, + { OUTPUT, "Output" }, + { PARAMARRAY, "ParamArray" }, + { PRESERVE, "Preserve" }, + { PRINT, "Print" }, + { PRIVATE, "Private" }, + { PROPERTY, "Property" }, + { PUBLIC, "Public" }, + { RANDOM, "Random" }, + { READ, "Read" }, + { REDIM, "ReDim" }, + { REM, "Rem" }, + { RESUME, "Resume" }, + { RETURN, "Return" }, + { RSET, "RSet" }, // JSM + { SELECT, "Select" }, + { SET, "Set" }, +#ifdef SHARED +#undef SHARED +#define tmpSHARED +#endif + { SHARED, "Shared" }, +#ifdef tmpSHARED +#define SHARED +#undef tmpSHARED +#endif + { TSINGLE, "Single" }, + { STATIC, "Static" }, + { STEP, "Step" }, + { STOP, "Stop" }, + { TSTRING, "String" }, + { SUB, "Sub" }, + { STOP, "System" }, + { TEXT, "Text" }, + { THEN, "Then" }, + { TO, "To", }, + { TYPE, "Type" }, + { TYPEOF, "TypeOf" }, + { UNTIL, "Until" }, + { TVARIANT, "Variant" }, + { VBASUPPORT, "VbaSupport" }, + { WEND, "Wend" }, + { WHILE, "While" }, + { WITH, "With" }, + { WRITE, "Write" }, // auch WRITE # + { XOR, "Xor" }, + { NIL, "" } +}; + +// Der Konstruktor ermittelt die Laenge der Token-Tabelle. + +SbiTokenizer::SbiTokenizer( const ::rtl::OUString& rSrc, StarBASIC* pb ) + : SbiScanner( rSrc, pb ) +{ + pTokTable = aTokTable_Basic; + TokenTable *tp; + bEof = bAs = FALSE; + eCurTok = NIL; + ePush = NIL; + bEos = bKeywords = bErrorIsSymbol = TRUE; + if( !nToken ) + for( nToken = 0, tp = pTokTable; tp->t; nToken++, tp++ ) {} +} + +SbiTokenizer::~SbiTokenizer() +{} + +// Einlesen des naechsten Tokens, ohne dass das Token geschluckt wird + +SbiToken SbiTokenizer::Peek() +{ + if( ePush == NIL ) + { + USHORT nOldLine = nLine; + USHORT nOldCol1 = nCol1; + USHORT nOldCol2 = nCol2; + ePush = Next(); + nPLine = nLine; nLine = nOldLine; + nPCol1 = nCol1; nCol1 = nOldCol1; + nPCol2 = nCol2; nCol2 = nOldCol2; + } + return eCurTok = ePush; +} + +// Einlesen des naechsten Tokens und Ablage desselben +// Tokens, die nicht in der Token-Tabelle vorkommen, werden +// direkt als Zeichen zurueckgeliefert. +// Einige Worte werden gesondert behandelt. + +SbiToken SbiTokenizer::Next() +{ + if (bEof) return EOLN; + // Schon eines eingelesen? + if( ePush != NIL ) + { + eCurTok = ePush; + ePush = NIL; + nLine = nPLine; + nCol1 = nPCol1; + nCol2 = nPCol2; + bEos = IsEoln( eCurTok ); + return eCurTok; + } + TokenTable *tp; + + // Sonst einlesen: + if( !NextSym() ) + { + bEof = bEos = TRUE; + return eCurTok = EOLN; + } + // Zeilenende? + if( aSym.GetBuffer()[0] == '\n' ) + { + bEos = TRUE; return eCurTok = EOLN; + } + bEos = FALSE; + + // Zahl? + if( bNumber ) + return eCurTok = NUMBER; + + // String? + else if( ( eScanType == SbxDATE || eScanType == SbxSTRING ) && !bSymbol ) + return eCurTok = FIXSTRING; + // Sonderfaelle von Zeichen, die zwischen "Z" und "a" liegen. ICompare() + // wertet die Position dieser Zeichen unterschiedlich aus. + else if( aSym.GetBuffer()[0] == '^' ) + return eCurTok = EXPON; + else if( aSym.GetBuffer()[0] == '\\' ) + return eCurTok = IDIV; + else + { + // Mit Typkennung oder ein Symbol und keine Keyword-Erkennung? + // Dann kein Token-Test + if( eScanType != SbxVARIANT + || ( !bKeywords && bSymbol ) ) + return eCurTok = SYMBOL; + // Gueltiges Token? + short lb = 0; + short ub = nToken-1; + short delta; + do + { + delta = (ub - lb) >> 1; + tp = &pTokTable[ lb + delta ]; + StringCompare res = aSym.CompareIgnoreCaseToAscii( tp->s ); + // Gefunden? + if( res == COMPARE_EQUAL ) goto special; + // Groesser? Dann untere Haelfte + if( res == COMPARE_LESS ) + { + if ((ub - lb) == 2) ub = lb; + else ub = ub - delta; + } + // Kleiner? Dann obere Haelfte + else + { + if ((ub -lb) == 2) lb = ub; + else lb = lb + delta; + } + } while( delta ); + // Symbol? Wenn nicht >= Token + sal_Unicode ch = aSym.GetBuffer()[0]; + if( !BasicSimpleCharClass::isAlpha( ch, bCompatible ) && !bSymbol ) + return eCurTok = (SbiToken) (ch & 0x00FF); + return eCurTok = SYMBOL; + } +special: + // LINE INPUT + if( tp->t == LINE ) + { + short nC1 = nCol1; + String aOldSym = aSym; + eCurTok = Peek(); + if( eCurTok == INPUT ) + { + Next(); + nCol1 = nC1; + return eCurTok = LINEINPUT; + } + else + { + aSym = aOldSym; + return eCurTok = LINE; + } + } + // END IF, CASE, SUB, DEF, FUNCTION, TYPE, CLASS, WITH + if( tp->t == END ) + { + // AB, 15.3.96, Spezialbehandlung fuer END, beim Peek() geht die + // aktuelle Zeile verloren, daher alles merken und danach restaurieren + USHORT nOldLine = nLine; + USHORT nOldCol = nCol; + USHORT nOldCol1 = nCol1; + USHORT nOldCol2 = nCol2; + String aOldSym = aSym; + SaveLine(); // pLine im Scanner sichern + + eCurTok = Peek(); + switch( eCurTok ) + { + case IF: Next(); eCurTok = ENDIF; break; + case SELECT: Next(); eCurTok = ENDSELECT; break; + case SUB: Next(); eCurTok = ENDSUB; break; + case FUNCTION: Next(); eCurTok = ENDFUNC; break; + case PROPERTY: Next(); eCurTok = ENDPROPERTY; break; + case TYPE: Next(); eCurTok = ENDTYPE; break; + case ENUM: Next(); eCurTok = ENDENUM; break; + case WITH: Next(); eCurTok = ENDWITH; break; + default : eCurTok = END; + } + nCol1 = nOldCol1; + if( eCurTok == END ) + { + // Alles zuruecksetzen, damit Token nach END ganz neu gelesen wird + ePush = NIL; + nLine = nOldLine; + nCol = nOldCol; + nCol2 = nOldCol2; + aSym = aOldSym; + RestoreLine(); // pLine im Scanner restaurieren + } + return eCurTok; + } + // Sind Datentypen Keywords? + // Nur nach AS, sonst sind es Symbole! + // Es gibt ja ERROR(), DATA(), STRING() etc. + eCurTok = tp->t; + // AS: Datentypen sind Keywords + if( tp->t == AS ) + bAs = TRUE; + else + { + if( bAs ) + bAs = FALSE; + else if( eCurTok >= DATATYPE1 && eCurTok <= DATATYPE2 && (bErrorIsSymbol || eCurTok != _ERROR_) ) + eCurTok = SYMBOL; + } + + // CLASSMODULE, PROPERTY, GET, ENUM token only visible in compatible mode + SbiToken eTok = tp->t; + if( bCompatible ) + { + // #129904 Suppress system + if( eTok == STOP && aSym.CompareIgnoreCaseToAscii( "system" ) == COMPARE_EQUAL ) + eCurTok = SYMBOL; + } + else + { + if( eTok == CLASSMODULE || + eTok == IMPLEMENTS || + eTok == PARAMARRAY || + eTok == ENUM || + eTok == PROPERTY || + eTok == GET || + eTok == TYPEOF ) + { + eCurTok = SYMBOL; + } + } + + bEos = IsEoln( eCurTok ); + return eCurTok; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/buffer.hxx b/bf_basic/source/inc/buffer.hxx new file mode 100644 index 00000000000..989d1b452bb --- /dev/null +++ b/bf_basic/source/inc/buffer.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _BUFFER_HXX +#define _BUFFER_HXX + +#include +#include + +namespace binfilter { + +class SbiParser; + +class SbiBuffer { // Code/Konstanten-Puffer: + SbiParser* pParser; // fuer Fehlermeldungen + char* pBuf; // Puffer-Pointer + char* pCur; // aktueller Puffer-Pointer + UINT32 nOff; // aktuelles Offset + UINT32 nSize; // aktuelle Groesse + short nInc; // Inkrement + BOOL Check( USHORT ); // Buffergroesse testen +public: + SbiBuffer( SbiParser*, short ); // Inkrement + ~SbiBuffer(); + BOOL operator += (const String&);// Basic-String speichern + BOOL operator += (INT8); // Zeichen speichern + BOOL operator += (INT16); // Integer speichern + BOOL operator += (UINT8); // Zeichen speichern + BOOL operator += (UINT16); // Integer speichern + BOOL operator += (UINT32); // Integer speichern + BOOL operator += (INT32); // Integer speichern + char* GetBuffer(); // Puffer rausgeben (selbst loeschen!) + char* GetBufferPtr(){ return pBuf; } + UINT32 GetSize() { return nOff; } +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/codegen.hxx b/bf_basic/source/inc/codegen.hxx new file mode 100644 index 00000000000..8971fa69e15 --- /dev/null +++ b/bf_basic/source/inc/codegen.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CODEGEN_HXX +#define _CODEGEN_HXX + +namespace binfilter { + +class SbiImage; +class SbiParser; +class SbModule; + +class SbiCodeGen { // Code-Erzeugung: +public: + static UINT32 calcNewOffSet( BYTE* pCode, UINT16 nOffset ); + static UINT16 calcLegacyOffSet( BYTE* pCode, UINT32 nOffset ); +}; + +template < class T, class S > +class PCodeBuffConvertor +{ + T m_nSize; // + BYTE* m_pStart; + BYTE* m_pCnvtdBuf; + S m_nCnvtdSize; // + + // Disable usual copying symantics and bodgy default ctor + PCodeBuffConvertor(); + PCodeBuffConvertor(const PCodeBuffConvertor& ); + PCodeBuffConvertor& operator = ( const PCodeBuffConvertor& ); +public: + PCodeBuffConvertor( BYTE* pCode, T nSize ): m_nSize( nSize ), m_pStart( pCode ), m_pCnvtdBuf( NULL ), m_nCnvtdSize( 0 ){ convert(); } + S GetSize(){ return m_nCnvtdSize; } + void convert(); + // Caller owns the buffer returned + BYTE* GetBuffer() { return m_pCnvtdBuf; } +}; + +// #111897 PARAM_INFO flags start at 0x00010000 to not +// conflict with DefaultId in SbxParamInfo::nUserData +#define PARAM_INFO_PARAMARRAY 0x0010000 + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/filefmt.hxx b/bf_basic/source/inc/filefmt.hxx new file mode 100644 index 00000000000..73626a342c3 --- /dev/null +++ b/bf_basic/source/inc/filefmt.hxx @@ -0,0 +1,185 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SB_FILEFMT_HXX +#define _SB_FILEFMT_HXX + +#include + +class SvStream; + +namespace binfilter { + +// Version 2: Datentyp des Returnwerts fuer Publics +// Version 3: neue Opcodes +// Version 4: neue Opcodes +// Version 5: Bug (Ansprung von STATIC-Variablen im Init-Code) +// Version 6: Neue Opcodes und Bug (Globals anlegen, ohne BASIC zu beenden) +// Version 7: Korrektur im WITH-Parsing +// Version 8: Korrektur im IF-Parsing +// Version 9: Init-Code auch mit LEAVE beenden, wenn keine SUB/FUNCTION folgt +// Version A: #36374 Bei DIM AS NEW... auch Variablen anlegen +// Version B: #40689 Static umgestellt +// Version C: #41606 Bug bei Static +// Version D: #42678 Bug bei RTL-Function spc +// Version E: #56204 DCREATE, um auch bei DIM AS NEW Arrays anzulegen +// Version F: #57844 Einfuehrung von SvNumberformat::StringToDouble +// Version 10: #29955 For-Schleifen-Level in Statement-PCodes generieren +// Version 11: #29955 Wegen Build-Inkonsistenzen Neu-Compilieren erzwingen + +#define B_LEGACYVERSION 0x00000011L +#define B_CURVERSION 0x00000012L +#define B_EXT_IMG_VERSION 0x00000012L + +// Eine Datei enthaelt entweder einen Modul- oder einen Library-Record. +// Diese Records enthalten wiederum weitere Records. Jeder Record hat +// den folgenden Header: + +// UINT16 Kennung +// UINT32 Laenge des Records ohne Header +// UINT16 Anzahl Unterelemente + +// Alle Datei-Offsets in Records sind relativ zum Start des Moduls! + +#define B_LIBRARY 0x4C42 // BL Library Record +#define B_MODULE 0x4D42 // BM Module Record +#define B_NAME 0x4E4D // MN module name +#define B_COMMENT 0x434D // MC comment +#define B_SOURCE 0x4353 // SC source code +#define B_PCODE 0x4350 // PC p-code +#define B_OLDPUBLICS 0x7550 // Pu publics +#define B_PUBLICS 0x5550 // PU publics +#define B_POOLDIR 0x4450 // PD symbol pool directory +#define B_SYMPOOL 0x5953 // SY symbol pool +#define B_STRINGPOOL 0x5453 // ST symbol pool +#define B_LINERANGES 0x524C // LR line ranges for publics +#define B_MODEND 0x454D // ME module end +#define B_SBXOBJECTS 0x5853 // SX SBX objects + +#define EXTENDED_BINARY_MODULES +#ifdef EXTENDED_BINARY_MODULES +#define B_EXTSOURCE 0x5345 // ES extended source +#endif + +// Ein Library Record enthaelt nur Module Records +// UINT16 Kennung BL +// UINT32 Laenge des Records +// UINT16 Anzahl Module + +// Ein Modul-Record enthaelt alle anderen Recordtypen +// UINT16 Kennung BM +// UINT32 Laenge des Records +// UINT16 1 +// Daten: +// UINT32 Versionsnummer +// UINT32 Zeichensatz +// UINT32 Startadresse Initialisierungscode +// UINT32 Startadresse Sub Main +// UINT32 Reserviert +// UINT32 Reserviert + +// Modulname, Kommentar und Quellcode: +// UINT16 Kennung MN, MC oder SC +// UINT32 Laenge des Records +// UINT16 1 +// Daten: +// String-Instanz + +// P-Code: +// UINT16 Kennung PC +// UINT32 Laenge des Records +// UINT16 1 +// Daten: +// Der P-Code als Bytesack + +// Alle Symbole und Strings werden in einem String-Pool gehalten. +// Verweise auf diese Strings sind in Form eines Indexes in diesen Pool. + +// Liste aller Publics: +// UINT16 Kennung PU oder Pu +// UINT32 Laenge des Records +// UINT16 Anzahl der Publics +// Daten fuer jeden Public-Eintrag: +// UINT16 String-Index +// UINT32 Startadresse im P-Code-Image (UINT16 fuer alte Publics) +// UINT16 Datentyp des Returnwertes (ab Version 2) + +// Verzeichnis der Symbol-Tabellen: +// UINT16 Kennung SP +// UINT32 Laenge des Records +// UINT16 Anzahl der Symboltabellen +// Daten fuer jede Symboltabelle: +// UINT16 Stringindex des Namens +// UINT16 Anzahl Symbole +// UINT16 Scope-Kennung + +// Symboltabelle: +// UINT16 Kennung SY +// UINT32 Laenge des Records +// UINT16 Anzahl der Symbole +// Daten: +// UINT16 Stringindex des Namens +// UINT16 Anzahl Symbole +// Daten fuer jedes Symbol: +// UINT16 Stringindex des Namens +// UINT16 Datentyp +// UINT16 Laenge bei STRING*n-Symbolen (0x8000: STATIC-Variable) + +// Stringpool: +// UINT16 Kennung ST +// UINT32 Laenge des Records +// UINT16 Anzahl der Strings +// Daten fuer jeden String: +// UINT32 Offset in den Block aller Strings +// Danach folgt der Block aller Strings, die dort als ASCIIZ-Strings liegen. + +// Line Ranges: +// UINT16 Kennung LR +// UINT32 Laenge des Records +// UINT16 Anzahl der Strings +// Daten fuer jedes Public: +// UINT16 1. Zeile (Sub XXX) +// UINT16 2. Zeile (End Sub) + +// SBX-Objekte: +// UINT16 Anzahl Objekte +// .... Objektdaten + +//////////////////////////////////////////////////////////////////////////// + +// Service-Routinen (in IMAGE.CXX) + +BOOL SbGood( SvStream& r ); +ULONG SbOpenRecord( SvStream&, UINT16 nSignature, UINT16 nElem ); +void SbCloseRecord( SvStream&, ULONG ); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/image.hxx b/bf_basic/source/inc/image.hxx new file mode 100644 index 00000000000..ed0306c863c --- /dev/null +++ b/bf_basic/source/inc/image.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SBIMAGE_HXX +#define _SBIMAGE_HXX + +#include "sbintern.hxx" +#include +#include "filefmt.hxx" + +// Diese Klasse liest das vom Compiler erzeugte Image ein und verwaltet +// den Zugriff auf die einzelnen Elemente. + +namespace binfilter { + +struct SbPublicEntry; + +class SbiImage { + friend class SbiCodeGen; // Compiler-Klassen, die die private- + + SbxArrayRef rTypes; // User defined types + SbxArrayRef rEnums; // Enum types + UINT32* pStringOff; // StringId-Offsets + sal_Unicode* pStrings; // StringPool + char* pCode; // Code-Image + char* pLegacyPCode; // Code-Image + BOOL bError; // TRUE: Fehler + USHORT nFlags; // Flags (s.u.) + short nStrings; // Anzahl Strings + UINT32 nStringSize; // Groesse des String-Puffers + UINT32 nCodeSize; // Groesse des Code-Blocks + UINT16 nLegacyCodeSize; // Groesse des Code-Blocks + UINT16 nDimBase; // OPTION BASE-Wert + rtl_TextEncoding eCharSet; // Zeichensatz fuer Strings + // temporaere Verwaltungs-Variable: + short nStringIdx; // aktueller String-Index + UINT32 nStringOff; // aktuelle Pos im Stringpuffer + // Routinen fuer Compiler: + void MakeStrings( short ); // StringPool einrichten + +public: + String aName; // Makroname + ::rtl::OUString aOUSource; // Quellcode + String aComment; // Kommentar + BOOL bInit; // TRUE: Init-Code ist gelaufen + BOOL bFirstInit; // TRUE, wenn das Image das erste mal nach + // dem Compilieren initialisiert wird. + SbiImage(); + ~SbiImage(); + void Clear(); // Inhalt loeschen + BOOL Load( SvStream&, UINT32& nVer ); // Loads image from stream + // nVer is set to version + // of image + BOOL Save( SvStream&, UINT32 = B_CURVERSION ) {return false; } + BOOL IsError() { return bError; } + + const char* GetCode() const { return pCode; } + UINT32 GetCodeSize() const { return nCodeSize; } + ::rtl::OUString& GetSource32() { return aOUSource; } + USHORT GetBase() const { return nDimBase; } + const SbxObject* FindType (String aTypeName) const; + + SbxArrayRef GetEnums() { return rEnums; } + + void SetFlag( USHORT n ) { nFlags |= n; } + USHORT GetFlag( USHORT n ) const { return nFlags & n; } + UINT16 CalcLegacyOffset( INT32 nOffset ); + UINT32 CalcNewOffset( INT16 nOffset ); + void ReleaseLegacyBuffer(); +}; + +#define SBIMG_EXPLICIT 0x0001 // OPTION EXPLICIT ist aktiv +#define SBIMG_COMPARETEXT 0x0002 // OPTION COMPARE TEXT ist aktiv +#define SBIMG_INITCODE 0x0004 // Init-Code vorhanden +#define SBIMG_CLASSMODULE 0x0008 // OPTION ClassModule is active +#define SBIMG_VBASUPPORT 0x0020 // OPTION VBASupport is 1 + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/opcodes.hxx b/bf_basic/source/inc/opcodes.hxx new file mode 100644 index 00000000000..49116f59e53 --- /dev/null +++ b/bf_basic/source/inc/opcodes.hxx @@ -0,0 +1,164 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _OPCODES_HXX +#define _OPCODES_HXX + +#include "sbintern.hxx" + +// Ein Opcode ist entweder 1, 3 oder 5 Bytes lang, je nach numerischen +// Wert des Opcodes (s.u.). + +enum SbiOpcode { + // Alle Opcodes ohne Operanden + _NOP = 0, + + SbOP0_START = _NOP, + + // Operatoren + // die folgenden Operatoren sind genauso angeordnet + // wie der enum SbxVarOp + _EXP, _MUL, _DIV, _MOD, _PLUS, _MINUS, _NEG, + _EQ, _NE, _LT, _GT, _LE, _GE, + _IDIV, _AND, _OR, _XOR, _EQV, _IMP, _NOT, + _CAT, + // Ende enum SbxVarOp + _LIKE, _IS, + // Laden/speichern + _ARGC, // neuen Argv einrichten + _ARGV, // TOS ==> aktueller Argv + _INPUT, // Input ==> TOS + _LINPUT, // Line Input ==> TOS + _GET, // TOS anfassen + _SET, // Speichern Objekt TOS ==> TOS-1 + _PUT, // TOS ==> TOS-1 + _PUTC, // TOS ==> TOS-1, dann ReadOnly + _DIM, // DIM + _REDIM, // REDIM + _REDIMP, // REDIM PRESERVE + _ERASE, // TOS loeschen + // Verzweigen + _STOP, // Programmende + _INITFOR, // FOR-Variable initialisieren + _NEXT, // FOR-Variable inkrementieren + _CASE, // Anfang CASE + _ENDCASE, // Ende CASE + _STDERROR, // Standard-Fehlerbehandlung + _NOERROR, // keine Fehlerbehandlung + _LEAVE, // UP verlassen + // E/A + _CHANNEL, // TOS = Kanalnummer + _BPRINT, // print TOS + _PRINTF, // print TOS in field + _BWRITE, // write TOS + _RENAME, // Rename Tos+1 to Tos + _PROMPT, // TOS = Prompt for Input + _RESTART, // Restartpunkt definieren + _CHAN0, // I/O-Kanal 0 + // Sonstiges + _EMPTY, // Leeren Ausdruck auf Stack + _ERROR, // TOS = Fehlercode + _LSET, // Speichern Objekt TOS ==> TOS-1 + _RSET, // Speichern Objekt TOS ==> TOS-1 + _REDIMP_ERASE, // Copies array to be later used by REDIM PRESERVE before erasing it + _INITFOREACH, + _VBASET, // VBA-like Set + SbOP0_END, + + // Alle Opcodes mit einem Operanden + + _NUMBER = 0x40, // Laden einer numerischen Konstanten (+ID) + + SbOP1_START = _NUMBER, + + _SCONST, // Laden einer Stringkonstanten (+ID) + _CONST, // Immediate Load (+Wert) + _ARGN, // Speichern eines named Args in Argv (+StringID) + _PAD, // String auf feste Laenge bringen (+Laenge) + // Verzweigungen + _JUMP, // Sprung (+Target) + _JUMPT, // TOS auswerten, bedingter Sprung (+Target) + _JUMPF, // TOS auswerten, bedingter Sprung (+Target) + _ONJUMP, // TOS auswerten, Sprung in JUMP-Tabelle (+MaxVal) + _GOSUB, // UP-Aufruf (+Target) + _RETURN, // UP-Return (+0 oder Target) + _TESTFOR, // FOR-Variable testen, inkrementieren (+Endlabel) + _CASETO, // Tos+1 <= Case <= Tos, 2xremove (+Target) + _ERRHDL, // Fehler-Handler (+Offset) + _RESUME, // Resume nach Fehlern (+0 or 1 or Label) + // E/A + _CLOSE, // (+Kanal/0) + _PRCHAR, // (+char) + // Verwaltung + _SETCLASS, // Set + Klassennamen testen (+StringId) + _TESTCLASS, // Check TOS class (+StringId) + _LIB, // Libnamen fuer Declare-Procs setzen (+StringId) + _BASED, // TOS wird um BASE erhoeht, BASE davor gepusht (+base) + // Typanpassung im Argv + _ARGTYP, // Letzten Parameter in Argv konvertieren (+Typ) + SbOP1_END, + + // Alle Opcodes mit zwei Operanden + + _RTL = 0x80, // Laden aus RTL (+StringID+Typ) + + SbOP2_START = _RTL, + + _FIND, // Laden (+StringID+Typ) + _ELEM, // Laden Element (+StringID+Typ) + _PARAM, // Parameter (+Offset+Typ) + // Verzweigen + _CALL, // DECLARE-Methode rufen (+StringID+Typ) + _CALLC, // Cdecl-DECLARE-Methode rufen (+StringID+Typ) + _CASEIS, // Case-Test (+Test-Opcode+True-Target) + // Verwaltung + _STMNT, // Beginn eines Statements (+Line+Col) + // E/A + _OPEN, // (+SvStreamFlags+Flags) + // Objekte + _LOCAL, // Lokale Variable definieren (+StringID+Typ) + _PUBLIC, // Modulglobale Variable (+StringID+Typ) + _GLOBAL, // Globale Variable definieren, public-Anweisung (+StringID+Typ) + _CREATE, // Objekt kreieren (+StringId+StringID) + _STATIC, // Statische Variabl (+StringID+Typ) JSM + _TCREATE, // User Defined Objekt kreieren + _DCREATE, // Objekt-Array kreieren (+StringId+StringID) + _GLOBAL_P, // Globale Variable definieren, die beim Neustart von Basic + // nicht ueberschrieben wird, P=PERSIST (+StringID+Typ) + _FIND_G, // Sucht globale Variable mit Spezialbehandlung wegen _GLOBAL_P + _DCREATE_REDIMP, // Objekt-Array redimensionieren (+StringId+StringID) + _FIND_CM, // Search inside a class module (CM) to enable global search in time + SbOP2_END + +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/sbintern.hxx b/bf_basic/source/inc/sbintern.hxx new file mode 100644 index 00000000000..1ce571a0acb --- /dev/null +++ b/bf_basic/source/inc/sbintern.hxx @@ -0,0 +1,141 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SB_INTERN_HXX +#define _SB_INTERN_HXX + +#include +#include +#include "sb.hxx" + +namespace +{ + class TransliterationWrapper; +} + +namespace binfilter { + +class SbUnoFactory; +class SbTypeFactory; +class SbOLEFactory; +class SbiInstance; +class SbModule; + +class SbiFactory : public SbxFactory +{ +public: + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxObject* CreateObject( const String& ); +}; + +struct SbClassData +{ + SbxArrayRef mxIfaces; + + ~SbClassData( void ) + { clear(); } + void clear( void ); +}; + +// #115824: Factory class to create class objects (type command) +// Implementation: sb.cxx +class SbClassFactory : public SbxFactory +{ + SbxObjectRef xClassModules; + +public: + SbClassFactory( void ); + virtual ~SbClassFactory(); + + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxObject* CreateObject( const String& ); +}; + +// Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette +class SbErrorStackEntry +{ +public: + SbErrorStackEntry(SbMethodRef aM, xub_StrLen nL, xub_StrLen nC1, xub_StrLen nC2) + : aMethod(aM), nLine(nL), nCol1(nC1), nCol2(nC2) {} + SbMethodRef aMethod; + xub_StrLen nLine; + xub_StrLen nCol1, nCol2; +}; + +SV_DECL_PTRARR_DEL(SbErrorStack, SbErrorStackEntry*, 1, 1) + + + +struct SbiGlobals +{ + SbiInstance* pInst; // alle aktiven Runtime-Instanzen + SbiFactory* pSbFac; // StarBASIC-Factory + SbUnoFactory* pUnoFac; // Factory fuer Uno-Structs bei DIM AS NEW + SbTypeFactory* pTypeFac; // Factory for user defined types + SbClassFactory* pClassFac; // Factory for user defined classes (based on class modules) + SbOLEFactory* pOLEFac; // Factory for OLE types + SbModule* pMod; // aktuell aktives Modul + SbModule* pCompMod; // aktuell compiliertes Modul + short nInst; // Anzahl BASICs + Link aErrHdl; // globaler Error-Handler + Link aBreakHdl; // globaler Break-Handler + SbError nCode; // aktueller Fehlercode + xub_StrLen nLine; // aktuelle Zeile + xub_StrLen nCol1,nCol2; // aktuelle Spalten (von,bis) + BOOL bCompiler; // Flag fuer Compiler-Error + BOOL bGlobalInitErr; // Beim GlobalInit trat ein Compiler-Fehler auf + BOOL bRunInit; // TRUE, wenn RunInit vom Basic aktiv ist + String aErrMsg; // Puffer fuer GetErrorText() + SbLanguageMode eLanguageMode; // Flag fuer Visual-Basic-Script-Modus + SbErrorStack* pErrStack; // Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette + ::utl::TransliterationWrapper* pTransliterationWrapper; // For StrComp + BOOL bBlockCompilerError; + BasicManager* pAppBasMgr; + + SbiGlobals(); + ~SbiGlobals(); +}; + +// Utility-Makros und -Routinen + +SbiGlobals* GetSbData(); + +#define pINST GetSbData()->pInst +#define pMOD GetSbData()->pMod +#define pCMOD GetSbData()->pCompMod +#define pSBFAC GetSbData()->pSbFac +#define pUNOFAC GetSbData()->pUnoFac +#define pTYPEFAC GetSbData()->pTypeFac +#define pCLASSFAC GetSbData()->pClassFac +#define pOLEFAC GetSbData()->pOLEFac + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/sbjsmeth.hxx b/bf_basic/source/inc/sbjsmeth.hxx new file mode 100644 index 00000000000..e67a1070a9d --- /dev/null +++ b/bf_basic/source/inc/sbjsmeth.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SB_SBJSMETH_HXX +#define _SB_SBJSMETH_HXX + +#include "sbmeth.hxx" + +namespace binfilter { + +// Basic-Modul fuer JavaScript-Sourcen. +// Alle Basic-spezifischen Methoden muessen virtuell ueberladen und deaktiviert +// werden. Die Unterscheidung von normalen Modulen erfolgt uebr RTTI. + +class SbJScriptMethod : public SbMethod +{ +public: + SbJScriptMethod( const String&, SbxDataType, SbModule* ); + virtual ~SbJScriptMethod(); + + SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMETH,2); + TYPEINFO(); +}; + +#ifndef __SB_SBJSCRIPTMETHODREF_HXX +#define __SB_SBJSCRIPTMETHODREF_HXX +SV_DECL_IMPL_REF(SbJScriptMethod) +#endif + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/sbjsmod.hxx b/bf_basic/source/inc/sbjsmod.hxx new file mode 100644 index 00000000000..5f11f5bce4b --- /dev/null +++ b/bf_basic/source/inc/sbjsmod.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SB_SBJSMOD_HXX +#define _SB_SBJSMOD_HXX + +#include "sbmod.hxx" + +namespace binfilter { + +// Basic-Modul fuer JavaScript-Sourcen. +// Alle Basic-spezifischen Methoden muessen virtuell ueberladen und deaktiviert +// werden. Die Unterscheidung von normalen Modulen erfolgt uebr RTTI. + +class SbJScriptModule : public SbModule +{ + virtual BOOL LoadData( SvStream&, USHORT ); + virtual BOOL StoreData( SvStream& ) const {return FALSE;} +public: + SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMOD,1); + TYPEINFO(); + SbJScriptModule( const String& ); // DURCHREICHEN +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/sbunoobj.hxx b/bf_basic/source/inc/sbunoobj.hxx new file mode 100644 index 00000000000..f8499f8a8b9 --- /dev/null +++ b/bf_basic/source/inc/sbunoobj.hxx @@ -0,0 +1,250 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SB_UNO_OBJ +#define SB_UNO_OBJ + +#include "sbxobj.hxx" +#include "sbxmeth.hxx" +#include "sbxprop.hxx" +#include "sbxfac.hxx" +#include "sbx.hxx" + +#include +#include +#include +#include +#include +#include +#ifndef _RTL_USTRING_ +#include +#endif + +namespace binfilter { + +using namespace com::sun::star::uno; +using namespace com::sun::star::beans; +using namespace com::sun::star::script; +using namespace com::sun::star::reflection; + +class SbUnoObject: public SbxObject +{ + Reference< XIntrospectionAccess > mxUnoAccess; + Reference< XMaterialHolder > mxMaterialHolder; + Reference< XInvocation > mxInvocation; + Reference< XExactName > mxExactName; + Reference< XExactName > mxExactNameInvocation; + BOOL bNeedIntrospection; + Any maTmpUnoObj; // Only to save obj for doIntrospection! + + // Hilfs-Methode zum Anlegen der dbg_-Properties + void implCreateDbgProperties( void ); + + // Hilfs-Methode zum Anlegen aller Properties und Methoden + // (Beim on-demand-Mechanismus erforderlich fuer die dbg_-Properties) + void implCreateAll( void ); + +public: + TYPEINFO(); + SbUnoObject( const String& aName_, const Any& aUnoObj_ ); + ~SbUnoObject(); + + // #76470 Introspection on Demand durchfuehren + void doIntrospection( void ); + + // Find ueberladen, um z.B. NameAccess zu unterstuetzen + virtual SbxVariable* Find( const String&, SbxClassType ); + + // Force creation of all properties for debugging + void createAllProperties( void ) + { implCreateAll(); } + + // Wert rausgeben + Any getUnoAny( void ); + Reference< XIntrospectionAccess > getIntrospectionAccess( void ) { return mxUnoAccess; } + Reference< XInvocation > getInvocation( void ) { return mxInvocation; } + + void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ); +}; +SV_DECL_IMPL_REF(SbUnoObject); + + +class SbUnoMethod : public SbxMethod +{ + friend class SbUnoObject; + + Reference< XIdlMethod > m_xUnoMethod; + Sequence* pParamInfoSeq; + + // #67781 Verweis auf vorige und naechste Methode in der Methoden-Liste + SbUnoMethod* pPrev; + SbUnoMethod* pNext; + + bool mbInvocation; // Method is based on invocation + +public: + TYPEINFO(); + + SbUnoMethod( const String& aName_, SbxDataType eSbxType, Reference< XIdlMethod > xUnoMethod_, + bool bInvocation ); + virtual ~SbUnoMethod(); + virtual SbxInfo* GetInfo(); + + const Sequence& getParamInfos( void ); + + bool isInvocationBased( void ) + { return mbInvocation; } +}; + + +class SbUnoProperty : public SbxProperty +{ + friend class SbUnoObject; + + // Daten der Uno-Property + Property aUnoProp; + INT32 nId; + + bool mbInvocation; // Property is based on invocation + + virtual ~SbUnoProperty(); +public: + TYPEINFO(); + SbUnoProperty( const String& aName_, SbxDataType eSbxType, + const Property& aUnoProp_, INT32 nId_, bool bInvocation ); + + bool isInvocationBased( void ) + { return mbInvocation; } +}; + +// Factory-Klasse fuer das Anlegen von Uno-Structs per DIM AS NEW +class SbUnoFactory : public SbxFactory +{ +public: + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxObject* CreateObject( const String& ); +}; + +// Wrapper fuer eine Uno-Klasse +class SbUnoClass: public SbxObject +{ + const Reference< XIdlClass > m_xClass; + +public: + TYPEINFO(); + SbUnoClass( const String& aName_ ) + : SbxObject( aName_ ) + {} + SbUnoClass( const String& aName_, const Reference< XIdlClass >& xClass_ ) + : SbxObject( aName_ ) + , m_xClass( xClass_ ) + {} + //~SbUnoClass(); + + // Find ueberladen, um Elemente on Demand anzulegen + virtual SbxVariable* Find( const String&, SbxClassType ); + + // Wert rausgeben + const Reference< XIdlClass >& getUnoClass( void ) { return m_xClass; } + + //void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ); +}; +SV_DECL_IMPL_REF(SbUnoClass); + + +// Funktion, um einen globalen Bezeichner im +// UnoScope zu suchen und fuer Sbx zu wrappen +SbxVariable* findUnoClass( const String& rName ); + + +// #105565 Special Object to wrap a strongly typed Uno Any +class SbUnoAnyObject: public SbxObject +{ + Any mVal; + +public: + SbUnoAnyObject( const Any& rVal ) + : SbxObject( String() ) + , mVal( rVal ) + {} + + const Any& getValue( void ) + { return mVal; } + + TYPEINFO(); +}; + + +// #112509 Special SbxArray to transport named parameters for calls +// to OLEAutomation objects through the UNO OLE automation bridge + +class AutomationNamedArgsSbxArray : public SbxArray +{ + Sequence< ::rtl::OUString > maNameSeq; +public: + TYPEINFO(); + AutomationNamedArgsSbxArray( sal_Int32 nSeqSize ) + : maNameSeq( nSeqSize ) + {} + + Sequence< ::rtl::OUString >& getNames( void ) + { return maNameSeq; } +}; + + +class StarBASIC; + +//======================================================================== +// #118116 Collection object + +class BasicCollection : public SbxObject +{ + friend class SbiRuntime; + SbxArrayRef xItemArray; + + void Initialize(); + virtual ~BasicCollection(); + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); + INT32 implGetIndex( SbxVariable* pIndexVar ); + INT32 implGetIndexForName( const String& rName ); + void CollAdd( SbxArray* pPar_ ); + void CollItem( SbxArray* pPar_ ); + void CollRemove( SbxArray* pPar_ ); + +public: + TYPEINFO(); + BasicCollection( const String& rClassname ); + virtual SbxVariable* Find( const String&, SbxClassType ); + virtual void Clear(); +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/scanner.hxx b/bf_basic/source/inc/scanner.hxx new file mode 100644 index 00000000000..30997cf96ca --- /dev/null +++ b/bf_basic/source/inc/scanner.hxx @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SCANNER_HXX +#define _SCANNER_HXX + +#include +#include "sberrors.hxx" + +namespace binfilter { + +// Der Scanner ist stand-alone, d.h. er kann von ueberallher verwendet +// werden. Eine BASIC-Instanz ist fuer Fehlermeldungen notwendig. Ohne +// BASIC werden die Fehler nur gezaehlt. Auch ist Basic notwendig, wenn +// eine erweiterte SBX-Variable zur Erkennung von Datentypen etc. verwendet +// werden soll. + +class StarBASIC; + +class SbiScanner +{ + ::rtl::OUString aBuf; // Input-Puffer + ::rtl::OUString aLine; // aktuelle Zeile + const sal_Unicode* pLine; // Pointer + const sal_Unicode* pSaveLine; // Merker fuer Line +protected: + String aSym; // Symbolpuffer + String aError; // Fehler-String + SbxDataType eScanType; // evtl. Datentyp + StarBASIC* pBasic; // Instanz fuer Fehler-Callbacks + double nVal; // numerischer Wert + short nCurCol1; // aktuelle Spalte 1 + short nSavedCol1; // gerettete Spalte 1 + short nCol; // aktuelle Spaltennummer + short nErrors; // Anzahl Fehler + short nColLock; // Lock-Zaehler fuer Col1 + INT32 nBufPos; // aktuelle Buffer-Pos + USHORT nLine; // aktuelle Zeile + USHORT nCol1, nCol2; // aktuelle 1. und 2. Spalte + BOOL bSymbol; // TRUE: Symbol gescannt + BOOL bNumber; // TRUE: Zahl gescannt + BOOL bSpaces; // TRUE: Whitespace vor Token + BOOL bErrors; // TRUE: Fehler generieren + BOOL bAbort; // TRUE: abbrechen + BOOL bHash; // TRUE: # eingelesen + BOOL bError; // TRUE: Fehler generieren + BOOL bUsedForHilite; // TRUE: Nutzung fuer Highlighting + BOOL bCompatible; // TRUE: OPTION Compatible + BOOL bPrevLineExtentsComment; // TRUE: Previous line is comment and ends on "... _" + + void GenError( SbError ); +public: + SbiScanner( const ::rtl::OUString&, StarBASIC* = NULL ); + ~SbiScanner(); + + void EnableErrors() { bError = FALSE; } + BOOL IsHash() { return bHash; } + BOOL IsCompatible() { return bCompatible; } + void SetCompatible( bool b ) { bCompatible = b; } // #118206 + BOOL WhiteSpace() { return bSpaces; } + short GetErrors() { return nErrors; } + short GetLine() { return nLine; } + short GetCol1() { return nCol1; } + short GetCol2() { return nCol2; } + void SetCol1( short n ) { nCol1 = n; } + StarBASIC* GetBasic() { return pBasic; } + void SaveLine(void) { pSaveLine = pLine; } + void RestoreLine(void) { pLine = pSaveLine; } + void LockColumn(); + void UnlockColumn(); + + BOOL NextSym(); // naechstes Symbol lesen + const String& GetSym() { return aSym; } + SbxDataType GetType() { return eScanType; } + double GetDbl() { return nVal; } +}; + +class LetterTable +{ + bool IsLetterTab[256]; + +public: + LetterTable( void ); + + inline bool isLetter( sal_Unicode c ) + { + bool bRet = (c < 256) ? IsLetterTab[c] : isLetterUnicode( c ); + return bRet; + } + bool isLetterUnicode( sal_Unicode c ); +}; + +class BasicSimpleCharClass +{ + static LetterTable aLetterTable; + +public: + static BOOL isAlpha( sal_Unicode c, bool bCompatible ) + { + BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') + || (bCompatible && aLetterTable.isLetter( c )); + return bRet; + } + + static BOOL isDigit( sal_Unicode c ) + { + BOOL bRet = (c >= '0' && c <= '9'); + return bRet; + } + + static BOOL isAlphaNumeric( sal_Unicode c, bool bCompatible ) + { + BOOL bRet = isDigit( c ) || isAlpha( c, bCompatible ); + return bRet; + } +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/inc/token.hxx b/bf_basic/source/inc/token.hxx new file mode 100644 index 00000000000..e553ba376ee --- /dev/null +++ b/bf_basic/source/inc/token.hxx @@ -0,0 +1,159 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOKEN_HXX +#define _TOKEN_HXX + +#include "scanner.hxx" +#include "sbdef.hxx" + +#if defined( SHARED ) +#define SbiTokenSHAREDTMPUNDEF +#undef SHARED +#endif + +namespace binfilter { + +// Der Tokenizer ist stand-alone, d.h. er kann von ueberallher verwendet +// werden. Eine BASIC-Instanz ist fuer Fehlermeldungen notwendig. Ohne +// BASIC werden die Fehler nur gezaehlt. Auch ist Basic notwendig, wenn +// eine erweiterte SBX-Variable zur Erkennung von Datentypen etc. verwendet +// werden soll. + +enum SbiToken { + NIL = 0, + // Token zwischen 0x20 und 0x3F sind Literale: + LPAREN = '(', RPAREN = ')', COMMA = ',', DOT = '.', EXCLAM = '!', + HASH = '#', SEMICOLON = ';', + + // Anweisungen: + FIRSTKWD = 0x40, + AS = FIRSTKWD, ALIAS, ASSIGN, + CALL, CASE, CLOSE, COMPARE, _CONST_, + DECLARE, DIM, DO, + + // in der Reihenfolge der Datentyp-Enums! + DEFINT, DEFLNG, DEFSNG, DEFDBL, DEFCUR, DEFDATE, DEFSTR, DEFOBJ, + DEFERR, DEFBOOL, DEFVAR, + // in der Reihenfolge der Datentyp-Enums! + DATATYPE1, + TINTEGER = DATATYPE1, + TLONG, TSINGLE, TDOUBLE, TCURRENCY, TDATE, TSTRING, TOBJECT, + _ERROR_, TBOOLEAN, TVARIANT, TBYTE, + DATATYPE2 = TBYTE, + + EACH, ELSE, ELSEIF, END, ERASE, EXIT, + FOR, FUNCTION, + GET, GLOBAL, GOSUB, GOTO, + IF, _IN_, INPUT, + LET, LINE, LINEINPUT, LOCAL, LOOP, LPRINT, LSET, + NAME, NEW, NEXT, + ON, OPEN, OPTION, IMPLEMENTS, + PRINT, PRIVATE, PROPERTY, PUBLIC, + REDIM, REM, RESUME, RETURN, RSET, + SELECT, SET, SHARED, STATIC, STEP, STOP, SUB, + TEXT, THEN, TO, TYPE, ENUM, + UNTIL, + WEND, WHILE, WITH, WRITE, + ENDENUM, ENDIF, ENDFUNC, ENDPROPERTY, ENDSUB, ENDTYPE, ENDSELECT, ENDWITH, + // Ende aller Keywords + LASTKWD = ENDWITH, + // Statement-Ende + EOS, EOLN, + // Operatoren: + EXPON, NEG, MUL, + DIV, IDIV, MOD, PLUS, MINUS, + EQ, NE, LT, GT, LE, GE, + NOT, AND, OR, XOR, EQV, + IMP, CAT, LIKE, IS, TYPEOF, + // Sonstiges: + FIRSTEXTRA, + NUMBER=FIRSTEXTRA, FIXSTRING, SYMBOL, _CDECL_, BYVAL, BYREF, + OUTPUT, RANDOM, APPEND, BINARY, ACCESS, + LOCK, READ, PRESERVE, BASE, ANY, LIB, _OPTIONAL_, + EXPLICIT, COMPATIBLE, CLASSMODULE, PARAMARRAY, + + // Ab hier kommen JavaScript-Tokens (gleiches enum, damit gleicher Typ) + FIRSTJAVA, + JS_BREAK=FIRSTJAVA, JS_CONTINUE, JS_FOR, JS_FUNCTION, JS_IF, JS_NEW, + JS_RETURN, JS_THIS, JS_VAR, JS_WHILE, JS_WITH, + + // JavaScript-Operatoren + // _ASS_ = Assignment + JS_COMMA, JS_ASSIGNMENT, JS_ASS_PLUS, JS_ASS_MINUS, JS_ASS_MUL, + JS_ASS_DIV, JS_ASS_MOD, JS_ASS_LSHIFT, JS_ASS_RSHIFT, JS_ASS_RSHIFT_Z, + JS_ASS_AND, JS_ASS_XOR, JS_ASS_OR, + JS_COND_QUEST, JS_COND_SEL, JS_LOG_OR, JS_LOG_AND, JS_BIT_OR, + JS_BIT_XOR, JS_BIT_AND, JS_EQ, JS_NE, JS_LT, JS_LE, + JS_GT, JS_GE, JS_LSHIFT, JS_RSHIFT, JS_RSHIFT_Z, + JS_PLUS, JS_MINUS, JS_MUL, JS_DIV, JS_MOD, JS_LOG_NOT, JS_BIT_NOT, + JS_INC, JS_DEC, JS_LPAREN, JS_RPAREN, JS_LINDEX, JS_RINDEX + , VBASUPPORT +}; + +#ifdef SbiTokenSHAREDTMPUNDEF +#define SHARED +#undef SbiTokenSHAREDTMPUNDEF +#endif + +class SbiTokenizer : public SbiScanner { +protected: + SbiToken eCurTok; // aktuelles Token + SbiToken ePush; // Pushback-Token + USHORT nPLine, nPCol1, nPCol2; // Pushback-Location + BOOL bEof; // TRUE bei Dateiende + BOOL bEos; // TRUE bei Statement-Ende + BOOL bKeywords; // TRUE, falls Keywords geparst werden + BOOL bAs; // letztes Keyword war AS + BOOL bErrorIsSymbol; // Handle Error token as Symbol, not keyword +public: + SbiTokenizer( const ::rtl::OUString&, StarBASIC* = NULL ); + ~SbiTokenizer(); + + inline BOOL IsEof() { return bEof; } + inline BOOL IsEos() { return bEos; } + + SbiToken Peek(); // das naechste Token lesen + SbiToken Next(); // Ein Token lesen + void Error( SbError c ) { GenError( c ); } + + void Keywords( BOOL b ) { bKeywords = b; } + + static BOOL IsEoln( SbiToken t ) + { return BOOL( t == EOS || t == EOLN || t == REM ); } + static BOOL IsKwd( SbiToken t ) + { return BOOL( t >= FIRSTKWD && t <= LASTKWD ); } + static BOOL IsExtra( SbiToken t ) + { return BOOL( t >= FIRSTEXTRA ); } +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/runtime/basrdll.cxx b/bf_basic/source/runtime/basrdll.cxx new file mode 100644 index 00000000000..b608847bf3a --- /dev/null +++ b/bf_basic/source/runtime/basrdll.cxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "basrdll.hxx" + +namespace binfilter { + + +BasicDLL::BasicDLL() +{ + bDebugMode = FALSE; + bBreakEnabled = TRUE; +} + +BasicDLL::~BasicDLL() +{ +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/runtime/makefile.mk b/bf_basic/source/runtime/makefile.mk new file mode 100644 index 00000000000..1b8799d962f --- /dev/null +++ b/bf_basic/source/runtime/makefile.mk @@ -0,0 +1,48 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=binfilter +TARGET=basic_runtime + +NO_HIDS=TRUE + +# --- Settings ----------------------------------------------------------- + +.INCLUDE : settings.mk + +INC+= -I$(PRJ)$/inc$/bf_basic + +# --- Allgemein ----------------------------------------------------------- + +SLOFILES= \ + $(SLO)$/basrdll.obj + +# --- Targets ------------------------------------------------------------- + +.INCLUDE : target.mk diff --git a/bf_basic/source/sbx/makefile.mk b/bf_basic/source/sbx/makefile.mk new file mode 100644 index 00000000000..9ecd05fa043 --- /dev/null +++ b/bf_basic/source/sbx/makefile.mk @@ -0,0 +1,77 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=binfilter +TARGET=basic_sbx + +NO_HIDS=TRUE + +# --- Settings ----------------------------------------------------------- + +.INCLUDE : settings.mk + +INC+= -I$(PRJ)$/inc$/bf_basic + +# --- Allgemein ----------------------------------------------------------- + +EXCEPTIONSFILES=$(SLO)$/sbxarray.obj + +SLOFILES= \ + $(EXCEPTIONSFILES) \ + $(SLO)$/sbxbase.obj \ + $(SLO)$/sbxvar.obj \ + $(SLO)$/sbxvalue.obj \ + $(SLO)$/sbxdec.obj \ + $(SLO)$/sbxint.obj \ + $(SLO)$/sbxcurr.obj \ + $(SLO)$/sbxstr.obj \ + $(SLO)$/sbxbool.obj \ + $(SLO)$/sbxdbl.obj \ + $(SLO)$/sbxdate.obj \ + $(SLO)$/sbxsng.obj \ + $(SLO)$/sbxlng.obj \ + $(SLO)$/sbxobj.obj \ + $(SLO)$/sbxscan.obj \ + $(SLO)$/sbxbyte.obj \ + $(SLO)$/sbxchar.obj \ + $(SLO)$/sbxulng.obj \ + $(SLO)$/sbxuint.obj \ + $(SLO)$/sbxcoll.obj \ + $(SLO)$/sbxres.obj \ + $(SLO)$/sbxexec.obj + +# $(SLO)$/sbxvals.obj \ + $(SLO)$/sbxmstrm.obj + + +# --- Targets ------------------------------------------------------------- + +.INCLUDE : target.mk + + diff --git a/bf_basic/source/sbx/sbxarray.cxx b/bf_basic/source/sbx/sbxarray.cxx new file mode 100644 index 00000000000..2d9ca62a7e0 --- /dev/null +++ b/bf_basic/source/sbx/sbxarray.cxx @@ -0,0 +1,745 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include +using namespace std; + +namespace binfilter { + +struct SbxDim { // eine Array-Dimension: + SbxDim* pNext; // Link + INT32 nLbound, nUbound; // Begrenzungen + INT32 nSize; // Anzahl Elemente +}; + +class SbxVarEntry : public SbxVariableRef { +public: + XubString* pAlias; + SbxVarEntry() : SbxVariableRef(), pAlias( NULL ) {} + ~SbxVarEntry() { delete pAlias; } +}; + +typedef SbxVarEntry* SbxVarEntryPtr; +typedef vector< SbxVarEntryPtr > SbxVarEntryPtrVector; +class SbxVarRefs : public SbxVarEntryPtrVector +{ +public: + SbxVarRefs( void ) {} +}; + + +TYPEINIT1(SbxArray,SbxBase) +TYPEINIT1(SbxDimArray,SbxArray) + +////////////////////////////////////////////////////////////////////////// +// +// SbxArray +// +////////////////////////////////////////////////////////////////////////// + +SbxArray::SbxArray( SbxDataType t ) : SbxBase() +{ + pData = new SbxVarRefs; + eType = t; + if( t != SbxVARIANT ) + SetFlag( SBX_FIXED ); +} + +SbxArray::SbxArray( const SbxArray& rArray ) : + SvRefBase( rArray ), SbxBase() +{ + pData = new SbxVarRefs; + if( rArray.eType != SbxVARIANT ) + SetFlag( SBX_FIXED ); + *this = rArray; +} + +SbxArray& SbxArray::operator=( const SbxArray& rArray ) +{ + if( &rArray != this ) + { + eType = rArray.eType; + Clear(); + SbxVarRefs* pSrc = rArray.pData; + for( UINT32 i = 0; i < pSrc->size(); i++ ) + { + SbxVarEntryPtr pSrcRef = (*pSrc)[i]; + SbxVarEntryPtr pDstRef = new SbxVarEntry; + *((SbxVariableRef*) pDstRef) = *((SbxVariableRef*) pSrcRef); + if( pSrcRef->pAlias ) + pDstRef->pAlias = new XubString( *pSrcRef->pAlias ); + const SbxVariable* pSrc_ = *pSrcRef; + if( pSrc_ ) + { + if( eType != SbxVARIANT ) + // Keine Objekte konvertieren + if( eType != SbxOBJECT || pSrc_->GetClass() != SbxCLASS_OBJECT ) + ((SbxVariable*) pSrc_)->Convert( eType ); + pData->push_back( pDstRef ); + } + } + } + return *this; +} + +SbxArray::~SbxArray() +{ + Clear(); + delete pData; +} + +SbxDataType SbxArray::GetType() const +{ + return (SbxDataType) ( eType | SbxARRAY ); +} + +SbxClassType SbxArray::GetClass() const +{ + return SbxCLASS_ARRAY; +} + +void SbxArray::Clear() +{ + UINT32 nSize = pData->size(); + for( UINT32 i = 0 ; i < nSize ; i++ ) + { + SbxVarEntry* pEntry = (*pData)[i]; + delete pEntry; + } + pData->clear(); +} + +UINT32 SbxArray::Count32() const +{ + return pData->size(); +} + +USHORT SbxArray::Count() const +{ + UINT32 nCount = pData->size(); + DBG_ASSERT( nCount <= SBX_MAXINDEX, "SBX: Array-Index > SBX_MAXINDEX" ); + return (USHORT)nCount; +} + +SbxVariableRef& SbxArray::GetRef32( UINT32 nIdx ) +{ + // Array ggf. vergroessern + DBG_ASSERT( nIdx <= SBX_MAXINDEX32, "SBX: Array-Index > SBX_MAXINDEX32" ); + // Very Hot Fix + if( nIdx > SBX_MAXINDEX32 ) + { + SetError( SbxERR_BOUNDS ); + nIdx = 0; + } + while( pData->size() <= nIdx ) + { + const SbxVarEntryPtr p = new SbxVarEntry; + pData->push_back( p ); + } + return *((*pData)[nIdx]); +} + +SbxVariableRef& SbxArray::GetRef( USHORT nIdx ) +{ + // Array ggf. vergroessern + DBG_ASSERT( nIdx <= SBX_MAXINDEX, "SBX: Array-Index > SBX_MAXINDEX" ); + // Very Hot Fix + if( nIdx > SBX_MAXINDEX ) + { + SetError( SbxERR_BOUNDS ); + nIdx = 0; + } + while( pData->size() <= nIdx ) + { + const SbxVarEntryPtr p = new SbxVarEntry; + pData->push_back( p ); + } + return *((*pData)[nIdx]); +} + +SbxVariable* SbxArray::Get32( UINT32 nIdx ) +{ + if( !CanRead() ) + { + SetError( SbxERR_PROP_WRITEONLY ); + return NULL; + } + SbxVariableRef& rRef = GetRef32( nIdx ); + + if ( !rRef.Is() ) + rRef = new SbxVariable( eType ); + + return rRef; +} + +SbxVariable* SbxArray::Get( USHORT nIdx ) +{ + if( !CanRead() ) + { + SetError( SbxERR_PROP_WRITEONLY ); + return NULL; + } + SbxVariableRef& rRef = GetRef( nIdx ); + + if ( !rRef.Is() ) + rRef = new SbxVariable( eType ); + + return rRef; +} + +void SbxArray::Put32( SbxVariable* pVar, UINT32 nIdx ) +{ + if( !CanWrite() ) + SetError( SbxERR_PROP_READONLY ); + else + { + if( pVar ) + if( eType != SbxVARIANT ) + // Keine Objekte konvertieren + if( eType != SbxOBJECT || pVar->GetClass() != SbxCLASS_OBJECT ) + pVar->Convert( eType ); + SbxVariableRef& rRef = GetRef32( nIdx ); + if( (SbxVariable*) rRef != pVar ) + { + rRef = pVar; + SetFlag( SBX_MODIFIED ); + } + } +} + +void SbxArray::Put( SbxVariable* pVar, USHORT nIdx ) +{ + if( !CanWrite() ) + SetError( SbxERR_PROP_READONLY ); + else + { + if( pVar ) + if( eType != SbxVARIANT ) + // Keine Objekte konvertieren + if( eType != SbxOBJECT || pVar->GetClass() != SbxCLASS_OBJECT ) + pVar->Convert( eType ); + SbxVariableRef& rRef = GetRef( nIdx ); + if( (SbxVariable*) rRef != pVar ) + { + rRef = pVar; + SetFlag( SBX_MODIFIED ); + } + } +} + +void SbxArray::Insert32( SbxVariable* pVar, UINT32 nIdx ) +{ + DBG_ASSERT( pData->size() <= SBX_MAXINDEX32, "SBX: Array wird zu gross" ); + if( pData->size() > SBX_MAXINDEX32 ) + return; + SbxVarEntryPtr p = new SbxVarEntry; + *((SbxVariableRef*) p) = pVar; + SbxVarEntryPtrVector::size_type nSize = pData->size(); + if( nIdx > nSize ) + nIdx = nSize; + if( eType != SbxVARIANT && pVar ) + (*p)->Convert( eType ); + if( nIdx == nSize ) + { + pData->push_back( p ); + } + else + { + pData->insert( pData->begin() + nIdx, p ); + } + SetFlag( SBX_MODIFIED ); +} + +void SbxArray::Insert( SbxVariable* pVar, USHORT nIdx ) +{ + DBG_ASSERT( pData->size() <= 0x3FF0, "SBX: Array wird zu gross" ); + if( pData->size() > 0x3FF0 ) + return; + Insert32( pVar, nIdx ); +} + +void SbxArray::Remove32( UINT32 nIdx ) +{ + if( nIdx < pData->size() ) + { + SbxVariableRef* pRef = (*pData)[nIdx]; + pData->erase( pData->begin() + nIdx ); + delete pRef; + SetFlag( SBX_MODIFIED ); + } +} + +void SbxArray::Remove( USHORT nIdx ) +{ + if( nIdx < pData->size() ) + { + SbxVariableRef* pRef = (*pData)[nIdx]; + pData->erase( pData->begin() + nIdx ); + delete pRef; + SetFlag( SBX_MODIFIED ); + } +} + +void SbxArray::Remove( SbxVariable* pVar ) +{ + if( pVar ) + { + for( UINT32 i = 0; i < pData->size(); i++ ) + { + SbxVariableRef* pRef = (*pData)[i]; + if( *pRef == pVar ) + { + Remove32( i ); break; + } + } + } +} + +// Uebernahme der Daten aus dem uebergebenen Array, wobei +// gleichnamige Variable ueberschrieben werden. + +void SbxArray::Merge( SbxArray* p ) +{ + if( p ) + { + UINT32 nSize = p->Count(); + for( UINT32 i = 0; i < nSize; i++ ) + { + SbxVarEntryPtr pRef1 = (*(p->pData))[i]; + // Ist das Element by name schon drin? + // Dann ueberschreiben! + SbxVariable* pVar = *pRef1; + if( pVar ) + { + XubString aName = pVar->GetName(); + USHORT nHash = pVar->GetHashCode(); + for( UINT32 j = 0; j < pData->size(); j++ ) + { + SbxVariableRef* pRef2 = (*pData)[j]; + if( (*pRef2)->GetHashCode() == nHash + && (*pRef2)->GetName().EqualsIgnoreCaseAscii( aName ) ) + { + *pRef2 = pVar; pRef1 = NULL; + break; + } + } + if( pRef1 ) + { + SbxVarEntryPtr pRef = new SbxVarEntry; + const SbxVarEntryPtr pTemp = pRef; + pData->push_back( pTemp ); + *((SbxVariableRef*) pRef) = *((SbxVariableRef*) pRef1); + if( pRef1->pAlias ) + pRef->pAlias = new XubString( *pRef1->pAlias ); + } + } + } + } +} + +// Suchen eines Elements ueber die Userdaten. Falls ein Element +// ein Objekt ist, wird dieses ebenfalls durchsucht. + +SbxVariable* SbxArray::FindUserData( UINT32 nData ) +{ + SbxVariable* p = NULL; + for( UINT32 i = 0; i < pData->size(); i++ ) + { + SbxVariableRef* pRef = (*pData)[i]; + SbxVariable* pVar = *pRef; + if( pVar ) + { + if( pVar->IsVisible() && pVar->GetUserData() == nData ) + { + p = pVar; + p->ResetFlag( SBX_EXTFOUND ); + break; + } + // Haben wir ein Array/Objekt mit Extended Search? + else if( pVar->IsSet( SBX_EXTSEARCH ) ) + { + switch( pVar->GetClass() ) + { + case SbxCLASS_OBJECT: + { + // Objekte duerfen ihren Parent nicht durchsuchen + USHORT nOld = pVar->GetFlags(); + pVar->ResetFlag( SBX_GBLSEARCH ); + p = ((SbxObject*) pVar)->FindUserData( nData ); + pVar->SetFlags( nOld ); + break; + } + case SbxCLASS_ARRAY: + p = ((SbxArray*) pVar)->FindUserData( nData ); + break; + default: break; + } + if( p ) + { + p->SetFlag( SBX_EXTFOUND ); + break; + } + } + } + } + return p; +} + +// Suchen eines Elements ueber den Namen und den Typ. Falls ein Element +// ein Objekt ist, wird dieses ebenfalls durchsucht. + +SbxVariable* SbxArray::Find( const XubString& rName, SbxClassType t ) +{ + SbxVariable* p = NULL; + UINT32 nCount = pData->size(); + if( !nCount ) + return NULL; + BOOL bExtSearch = IsSet( SBX_EXTSEARCH ); + USHORT nHash = SbxVariable::MakeHashCode( rName ); + for( UINT32 i = 0; i < nCount; i++ ) + { + SbxVariableRef* pRef = (*pData)[i]; + SbxVariable* pVar = *pRef; + if( pVar && pVar->IsVisible() ) + { + // Die ganz sichere Suche klappt auch, wenn es + // keinen Hascode gibt! + USHORT nVarHash = pVar->GetHashCode(); + if( ( !nVarHash || nVarHash == nHash ) + && ( t == SbxCLASS_DONTCARE || pVar->GetClass() == t ) + && ( pVar->GetName().EqualsIgnoreCaseAscii( rName ) ) ) + { + p = pVar; + p->ResetFlag( SBX_EXTFOUND ); + break; + } + // Haben wir ein Array/Objekt mit Extended Search? + else if( bExtSearch && pVar->IsSet( SBX_EXTSEARCH ) ) + { + switch( pVar->GetClass() ) + { + case SbxCLASS_OBJECT: + { + // Objekte duerfen ihren Parent nicht durchsuchen + USHORT nOld = pVar->GetFlags(); + pVar->ResetFlag( SBX_GBLSEARCH ); + p = ((SbxObject*) pVar)->Find( rName, t ); + pVar->SetFlags( nOld ); + break; + } + case SbxCLASS_ARRAY: + p = ((SbxArray*) pVar)->Find( rName, t ); + break; + default: break; + } + if( p ) + { + p->SetFlag( SBX_EXTFOUND ); + break; + } + } + } + } + return p; +} + +BOOL SbxArray::LoadData( SvStream& rStrm, USHORT nVer ) +{ + UINT16 nElem; + Clear(); + BOOL bRes = TRUE; + USHORT f = nFlags; + nFlags |= SBX_WRITE; + rStrm >> nElem; + nElem &= 0x7FFF; + for( UINT32 n = 0; n < nElem; n++ ) + { + UINT16 nIdx; + rStrm >> nIdx; + SbxVariable* pVar = (SbxVariable*) Load( rStrm ); + if( pVar ) + { + SbxVariableRef& rRef = GetRef( nIdx ); + rRef = pVar; + } + else + { + bRes = FALSE; break; + } + } + if( bRes ) + bRes = LoadPrivateData( rStrm, nVer ); + nFlags = f; + return bRes; +} + +// #100883 Method to set method directly to parameter array +void SbxArray::PutDirect( SbxVariable* pVar, UINT32 nIdx ) +{ + SbxVariableRef& rRef = GetRef32( nIdx ); + rRef = pVar; +} + + +////////////////////////////////////////////////////////////////////////// +// +// SbxArray +// +////////////////////////////////////////////////////////////////////////// + +SbxDimArray::SbxDimArray( SbxDataType t ) : SbxArray( t ) +{ + pFirst = pLast = NULL; + nDim = 0; +} + +SbxDimArray::SbxDimArray( const SbxDimArray& rArray ) + : SvRefBase( rArray ), SbxArray( rArray.eType ) +{ + pFirst = pLast = NULL; + nDim = 0; + *this = rArray; +} + +SbxDimArray& SbxDimArray::operator=( const SbxDimArray& rArray ) +{ + if( &rArray != this ) + { + SbxArray::operator=( (const SbxArray&) rArray ); + SbxDim* p = rArray.pFirst; + while( p ) + { + AddDim32( p->nLbound, p->nUbound ); + p = p->pNext; + } + } + return *this; +} + +SbxDimArray::~SbxDimArray() +{ + Clear(); +} + +void SbxDimArray::Clear() +{ + SbxDim* p = pFirst; + while( p ) + { + SbxDim* q = p->pNext; + delete p; + p = q; + } + pFirst = pLast = NULL; + nDim = 0; +} + +// Dimension hinzufuegen + +void SbxDimArray::AddDimImpl32( INT32 lb, INT32 ub, BOOL bAllowSize0 ) +{ + SbxError eRes = SbxERR_OK; + if( ub < lb && !bAllowSize0 ) + { + eRes = SbxERR_BOUNDS; + ub = lb; + } + SbxDim* p = new SbxDim; + p->nLbound = lb; + p->nUbound = ub; + p->nSize = ub - lb + 1; + p->pNext = NULL; + if( !pFirst ) + pFirst = pLast = p; + else + pLast->pNext = p, pLast = p; + nDim++; + if( eRes ) + SetError( eRes ); +} + +void SbxDimArray::AddDim( short lb, short ub ) +{ + AddDimImpl32( lb, ub, FALSE ); +} + +void SbxDimArray::unoAddDim( short lb, short ub ) +{ + AddDimImpl32( lb, ub, TRUE ); +} + +void SbxDimArray::AddDim32( INT32 lb, INT32 ub ) +{ + AddDimImpl32( lb, ub, FALSE ); +} + +void SbxDimArray::unoAddDim32( INT32 lb, INT32 ub ) +{ + AddDimImpl32( lb, ub, TRUE ); +} + + +// Dimensionsdaten auslesen + +BOOL SbxDimArray::GetDim32( INT32 n, INT32& rlb, INT32& rub ) const +{ + if( n < 1 || n > nDim ) + { + SetError( SbxERR_BOUNDS ); rub = rlb = 0; return FALSE; + } + SbxDim* p = pFirst; + while( --n ) + p = p->pNext; + rub = p->nUbound; + rlb = p->nLbound; + return TRUE; +} + +BOOL SbxDimArray::GetDim( short n, short& rlb, short& rub ) const +{ + INT32 rlb32, rub32; + BOOL bRet = GetDim32( n, rlb32, rub32 ); + if( bRet ) + { + if( rlb32 < -SBX_MAXINDEX || rub32 > SBX_MAXINDEX ) + { + SetError( SbxERR_BOUNDS ); + return FALSE; + } + rub = (short)rub32; + rlb = (short)rlb32; + } + return bRet; +} + +// Element-Ptr anhand einer Index-Liste + +UINT32 SbxDimArray::Offset32( const INT32* pIdx ) +{ + UINT32 nPos = 0; + for( SbxDim* p = pFirst; p; p = p->pNext ) + { + INT32 nIdx = *pIdx++; + if( nIdx < p->nLbound || nIdx > p->nUbound ) + { + nPos = (UINT32)SBX_MAXINDEX32 + 1; break; + } + nPos = nPos * p->nSize + nIdx - p->nLbound; + } + if( nDim == 0 || nPos > SBX_MAXINDEX32 ) + { + SetError( SbxERR_BOUNDS ); nPos = 0; + } + return nPos; +} + +USHORT SbxDimArray::Offset( const short* pIdx ) +{ + long nPos = 0; + for( SbxDim* p = pFirst; p; p = p->pNext ) + { + short nIdx = *pIdx++; + if( nIdx < p->nLbound || nIdx > p->nUbound ) + { + nPos = SBX_MAXINDEX + 1; break; + } + nPos = nPos * p->nSize + nIdx - p->nLbound; + } + if( nDim == 0 || nPos > SBX_MAXINDEX ) + { + SetError( SbxERR_BOUNDS ); nPos = 0; + } + return (USHORT) nPos; +} + +SbxVariable* SbxDimArray::Get( const short* pIdx ) +{ + return SbxArray::Get( Offset( pIdx ) ); +} + +SbxVariable* SbxDimArray::Get32( const INT32* pIdx ) +{ + return SbxArray::Get32( Offset32( pIdx ) ); +} + +void SbxDimArray::Put32( SbxVariable* p, const INT32* pIdx ) +{ + SbxArray::Put32( p, Offset32( pIdx ) ); +} + + +// Element-Nr anhand eines Parameter-Arrays + +UINT32 SbxDimArray::Offset32( SbxArray* pPar ) +{ + if( nDim == 0 || !pPar ) + { + SetError( SbxERR_BOUNDS ); return 0; + } + UINT32 nPos = 0; + USHORT nOff = 1; // Nicht Element 0! + for( SbxDim* p = pFirst; p && !IsError(); p = p->pNext ) + { + INT32 nIdx = pPar->Get( nOff++ )->GetLong(); + if( nIdx < p->nLbound || nIdx > p->nUbound ) + { + nPos = (UINT32) SBX_MAXINDEX32+1; break; + } + nPos = nPos * p->nSize + nIdx - p->nLbound; + } + if( nPos > (UINT32) SBX_MAXINDEX32 ) + { + SetError( SbxERR_BOUNDS ); nPos = 0; + } + return nPos; +} + +SbxVariable* SbxDimArray::Get( SbxArray* pPar ) +{ + return SbxArray::Get32( Offset32( pPar ) ); +} + +BOOL SbxDimArray::LoadData( SvStream& rStrm, USHORT nVer ) +{ + short nDimension; + rStrm >> nDimension; + for( short i = 0; i < nDimension && rStrm.GetError() == SVSTREAM_OK; i++ ) + { + INT16 lb, ub; + rStrm >> lb >> ub; + AddDim( lb, ub ); + } + return SbxArray::LoadData( rStrm, nVer ); +} + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxbase.cxx b/bf_basic/source/sbx/sbxbase.cxx new file mode 100644 index 00000000000..2a380c1e4c3 --- /dev/null +++ b/bf_basic/source/sbx/sbxbase.cxx @@ -0,0 +1,365 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include + +#include "sbx.hxx" +#include "sbxfac.hxx" +#include "sbxbase.hxx" + +namespace binfilter { + +// AppData-Struktur fuer SBX: + +SV_IMPL_PTRARR(SbxParams,SbxParamInfo*); +SV_IMPL_PTRARR(SbxFacs,SbxFactory*); + +TYPEINIT0(SbxBase) + +// SBX-Daten anfordern oder ggf. anlegen +// wir legen den Bereich einfach an und verzichten auf die Freigabe! + +SbxAppData* GetSbxData_Impl() +{ + DBG_TESTSOLARMUTEX(); + static SbxAppData* pAppData = new SbxAppData; + return pAppData; +} + +//////////////////////////////// SbxBase ///////////////////////////////// + +DBG_NAME(SbxBase); + +SbxBase::SbxBase() +{ + DBG_CTOR( SbxBase, 0 ); + nFlags = SBX_READWRITE; +} + +SbxBase::SbxBase( const SbxBase& r ) + : SvRefBase( r ) +{ + DBG_CTOR( SbxBase, 0 ); + nFlags = r.nFlags; +} + +SbxBase::~SbxBase() +{ + DBG_DTOR(SbxBase,0); +} + +SbxBase& SbxBase::operator=( const SbxBase& r ) +{ + DBG_CHKTHIS( SbxBase, 0 ); + nFlags = r.nFlags; + return *this; +} + +SbxDataType SbxBase::GetType() const +{ + DBG_CHKTHIS( SbxBase, 0 ); + return SbxEMPTY; +} + +SbxClassType SbxBase::GetClass() const +{ + DBG_CHKTHIS( SbxBase, 0 ); + return SbxCLASS_DONTCARE; +} + +void SbxBase::Clear() +{ + DBG_CHKTHIS( SbxBase, 0 ); +} + +BOOL SbxBase::IsFixed() const +{ + DBG_CHKTHIS( SbxBase, 0 ); + return IsSet( SBX_FIXED ); +} + +void SbxBase::SetModified( BOOL b ) +{ + DBG_CHKTHIS( SbxBase, 0 ); + if( IsSet( SBX_NO_MODIFY ) ) + return; + if( b ) + SetFlag( SBX_MODIFIED ); + else + ResetFlag( SBX_MODIFIED ); +} + +SbxError SbxBase::GetError() +{ + return GetSbxData_Impl()->eSbxError; +} + +void SbxBase::SetError( SbxError e ) +{ + SbxAppData* p = GetSbxData_Impl(); + if( e && p->eSbxError == SbxERR_OK ) + p->eSbxError = e; +} + +BOOL SbxBase::IsError() +{ + return BOOL( GetSbxData_Impl()->eSbxError != SbxERR_OK ); +} + +void SbxBase::ResetError() +{ + GetSbxData_Impl()->eSbxError = SbxERR_OK; +} + +void SbxBase::AddFactory( SbxFactory* pFac ) +{ + SbxAppData* p = GetSbxData_Impl(); + const SbxFactory* pTemp = pFac; + + // AB, 6.3.96: HandleLast-Flag beruecksichtigen + USHORT nPos = p->aFacs.Count(); // Einfuege-Position + if( !pFac->IsHandleLast() ) // Nur, wenn nicht selbst HandleLast + { + // Neue Factory vor Factories mit HandleLast einordnen + while( nPos > 0 && + (static_cast(p->aFacs.GetObject( nPos-1 )))->IsHandleLast() ) + nPos--; + } + p->aFacs.Insert( pTemp, nPos ); +} + +void SbxBase::RemoveFactory( SbxFactory* pFac ) +{ + SbxAppData* p = GetSbxData_Impl(); + for( USHORT i = 0; i < p->aFacs.Count(); i++ ) + { + if( p->aFacs.GetObject( i ) == pFac ) + { + p->aFacs.Remove( i, 1 ); break; + } + } +} + + +SbxBase* SbxBase::Create( UINT16 nSbxId, UINT32 nCreator ) +{ + // #91626: Hack to skip old Basic dialogs + // Problem: There does not exist a factory any more, + // so we have to create a dummy SbxVariable instead + if( nSbxId == 0x65 ) // Dialog Id + return new SbxVariable; + + XubString aEmptyStr; + if( nCreator == SBXCR_SBX ) + switch( nSbxId ) + { + case SBXID_VALUE: return new SbxValue; + case SBXID_VARIABLE: return new SbxVariable; + case SBXID_ARRAY: return new SbxArray; + case SBXID_DIMARRAY: return new SbxDimArray; + case SBXID_OBJECT: return new SbxObject( aEmptyStr ); + case SBXID_COLLECTION: return new SbxCollection( aEmptyStr ); + case SBXID_FIXCOLLECTION: + return new SbxStdCollection( aEmptyStr, aEmptyStr ); + case SBXID_METHOD: return new SbxMethod( aEmptyStr, SbxEMPTY ); + case SBXID_PROPERTY: return new SbxProperty( aEmptyStr, SbxEMPTY ); + } + // Unbekanter Typ: ?ber die Factories gehen! + SbxAppData* p = GetSbxData_Impl(); + SbxBase* pNew = NULL; + for( USHORT i = 0; i < p->aFacs.Count(); i++ ) + { + SbxFactory* pFac = p->aFacs.GetObject( i ); + pNew = pFac->Create( nSbxId, nCreator ); + if( pNew ) + break; + } + return pNew; +} + +SbxObject* SbxBase::CreateObject( const rtl::OUString& rClass ) +{ + SbxAppData* p = GetSbxData_Impl(); + SbxObject* pNew = NULL; + for( USHORT i = 0; i < p->aFacs.Count(); i++ ) + { + pNew = p->aFacs.GetObject( i )->CreateObject( rClass ); + if( pNew ) + break; + } + SAL_WARN_IF(!pNew, "binfilter", "No factory for object class " << rClass); + return pNew; +} + +static BOOL bStaticEnableBroadcasting = TRUE; + +// Sbx-Loesung als Ersatz fuer SfxBroadcaster::Enable() +BOOL SbxBase::StaticIsEnabledBroadcasting( void ) +{ + return bStaticEnableBroadcasting; +} + +SbxBase* SbxBase::Load( SvStream& rStrm ) +{ + UINT16 nSbxId, nFlags, nVer; + UINT32 nCreator, nSize; + rStrm >> nCreator >> nSbxId >> nFlags >> nVer; + + // Eine Dummheit meinerseits korrigieren: + if( nFlags & SBX_RESERVED ) + nFlags = ( nFlags & ~SBX_RESERVED ) | SBX_GBLSEARCH; + + ULONG nOldPos = rStrm.Tell(); + rStrm >> nSize; + SbxBase* p = Create( nSbxId, nCreator ); + if( p ) + { + p->nFlags = nFlags; + if( p->LoadData( rStrm, nVer ) ) + { + ULONG nNewPos = rStrm.Tell(); + nOldPos += nSize; + DBG_ASSERT( nOldPos >= nNewPos, "SBX: Zu viele Daten eingelesen" ); + if( nOldPos != nNewPos ) + rStrm.Seek( nOldPos ); + if( !p->LoadCompleted() ) + { + // Loeschen des Objekts + SbxBaseRef aRef( p ); + p = NULL; + } + } + else + { + rStrm.SetError( SVSTREAM_FILEFORMAT_ERROR ); + // Loeschen des Objekts + SbxBaseRef aRef( p ); + p = NULL; + } + } + else + rStrm.SetError( SVSTREAM_FILEFORMAT_ERROR ); + return p; +} + +// Sbx-Objekt im Stream ueberspringen +void SbxBase::Skip( SvStream& rStrm ) +{ + UINT16 nSbxId, nFlags, nVer; + UINT32 nCreator, nSize; + rStrm >> nCreator >> nSbxId >> nFlags >> nVer; + + ULONG nStartPos = rStrm.Tell(); + rStrm >> nSize; + + rStrm.Seek( nStartPos + nSize ); +} + +BOOL SbxBase::LoadData( SvStream&, USHORT ) +{ + DBG_CHKTHIS( SbxBase, 0 ); + return FALSE; +} + +BOOL SbxBase::LoadPrivateData( SvStream&, USHORT ) +{ + DBG_CHKTHIS( SbxBase, 0 ); + return TRUE; +} + +BOOL SbxBase::StorePrivateData( SvStream& ) const +{ + DBG_CHKTHIS( SbxBase, 0 ); + return TRUE; +} + +BOOL SbxBase::LoadCompleted() +{ + DBG_CHKTHIS( SbxBase, 0 ); + return TRUE; +} + +BOOL SbxBase::StoreCompleted() +{ + DBG_CHKTHIS( SbxBase, 0 ); + return TRUE; +} + +//////////////////////////////// SbxFactory //////////////////////////////// + +SbxBase* SbxFactory::Create( UINT16, UINT32 ) +{ + return NULL; +} + +SbxObject* SbxFactory::CreateObject( const XubString& ) +{ + return NULL; +} + +///////////////////////////////// SbxInfo ////////////////////////////////// + +SbxInfo::~SbxInfo() +{} + +void SbxInfo::AddParam + ( const XubString& rName, SbxDataType eType, USHORT nFlags ) +{ + const SbxParamInfo* p = new SbxParamInfo( rName, eType, nFlags ); + aParams.Insert( p, aParams.Count() ); +} + +BOOL SbxInfo::LoadData( SvStream& rStrm, USHORT nVer ) +{ + aParams.Remove( 0, aParams.Count() ); + UINT16 nParam; + rStrm.ReadByteString( aComment, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aHelpFile, RTL_TEXTENCODING_ASCII_US ); + rStrm >> nHelpId >> nParam; + while( nParam-- ) + { + XubString aName; + UINT16 nType, nFlags; + UINT32 nUserData = 0; + rStrm.ReadByteString( aName, RTL_TEXTENCODING_ASCII_US ); + rStrm >> nType >> nFlags; + if( nVer > 1 ) + rStrm >> nUserData; + AddParam( aName, (SbxDataType) nType, nFlags ); + SbxParamInfo* p = aParams.GetObject( aParams.Count() - 1 ); + p->nUserData = nUserData; + } + return TRUE; +} + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxbool.cxx b/bf_basic/source/sbx/sbxbool.cxx new file mode 100644 index 00000000000..8aaa1652f9e --- /dev/null +++ b/bf_basic/source/sbx/sbxbool.cxx @@ -0,0 +1,251 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" +#include "sbxres.hxx" + +namespace binfilter { + +enum SbxBOOL ImpGetBool( const SbxValues* p ) +{ + enum SbxBOOL nRes; + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = SbxFALSE; break; + case SbxCHAR: + nRes = p->nChar ? SbxTRUE : SbxFALSE; break; + case SbxBYTE: + nRes = p->nByte ? SbxTRUE : SbxFALSE; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger ? SbxTRUE : SbxFALSE; break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort ? SbxTRUE : SbxFALSE; break; + case SbxLONG: + nRes = p->nLong ? SbxTRUE : SbxFALSE; break; + case SbxULONG: + nRes = p->nULong ? SbxTRUE : SbxFALSE; break; + case SbxSINGLE: + nRes = p->nSingle ? SbxTRUE : SbxFALSE; break; + case SbxDATE: + case SbxDOUBLE: + nRes = p->nDouble ? SbxTRUE : SbxFALSE; break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double dVal = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( dVal ); + nRes = dVal ? SbxTRUE : SbxFALSE; + } + break; + case SbxSALINT64: + nRes = p->nInt64 ? SbxTRUE : SbxFALSE; break; + case SbxSALUINT64: + nRes = p->uInt64 ? SbxTRUE : SbxFALSE; break; + case SbxULONG64: + nRes = !!p->nULong64 ? SbxTRUE : SbxFALSE; break; + case SbxLONG64: + case SbxCURRENCY: + nRes = !!p->nLong64 ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + nRes = SbxFALSE; + if( p->pString ) + { + if( p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_TRUE ) ) ) + nRes = SbxTRUE; + else if( !p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_FALSE ) ) ) + { + // Jetzt kann es noch in eine Zahl konvertierbar sein + BOOL bError = TRUE; + double n; + SbxDataType t; + USHORT nLen = 0; + String s( *p->pString ); + if( ImpScan( s, n, t, &nLen ) == SbxERR_OK ) + { + if( nLen == s.Len() ) + { + bError = FALSE; + if( n != 0.0 ) + nRes = SbxTRUE; + } + } + if( bError ) + SbxBase::SetError( SbxERR_CONVERSION ); + } + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetBool() ? SbxTRUE : SbxFALSE; + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = SbxFALSE; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxLONG: + nRes = *p->pLong ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxULONG: + nRes = *p->pULong ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + nRes = *p->pUShort ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxSINGLE: + nRes = ( *p->pSingle != 0 ) ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + nRes = ( *p->pDouble != 0 ) ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxSALINT64: + nRes = ( *p->pnInt64 ) ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxSALUINT64: + nRes = ( *p->puInt64 ) ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxULONG64: + nRes = !!*p->pULong64 ? SbxTRUE : SbxFALSE; break; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + nRes = !!*p->pLong64 ? SbxTRUE : SbxFALSE; break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = SbxFALSE; + } + return nRes; +} + +void ImpPutBool( SbxValues* p, INT16 n ) +{ + if( n ) + n = SbxTRUE; + switch( +p->eType ) + { + case SbxCHAR: + p->nChar = (xub_Unicode) n; break; + case SbxUINT: + p->nByte = (BYTE) n; break; + case SbxINTEGER: + case SbxBOOL: + p->nInteger = n; break; + case SbxLONG: + p->nLong = n; break; + case SbxULONG: + p->nULong = (UINT32) n; break; + case SbxERROR: + case SbxUSHORT: + p->nUShort = (UINT16) n; break; + case SbxSINGLE: + p->nSingle = n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + case SbxSALINT64: + p->nInt64 = n; break; + case SbxSALUINT64: + p->uInt64 = n; break; + case SbxULONG64: + p->nULong64.Set( (UINT32)n ); break; + case SbxLONG64: + case SbxCURRENCY: + p->nLong64.Set( (INT32)n ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + ImpCreateDecimal( p )->setInt( (INT16)n ); + break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + *p->pString = SbxRes( n ? STRING_TRUE : STRING_FALSE ); + break; + + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutBool( BOOL( n != 0 ) ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + *p->pLong = n; break; + case SbxBYREF | SbxULONG: + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = n; break; + case SbxBYREF | SbxULONG64: + p->pULong64->Set( (UINT32)n ); break; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + p->pLong64->Set( (INT32)n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxbyte.cxx b/bf_basic/source/sbx/sbxbyte.cxx new file mode 100644 index 00000000000..042578b9504 --- /dev/null +++ b/bf_basic/source/sbx/sbxbyte.cxx @@ -0,0 +1,333 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +BYTE ImpGetByte( const SbxValues* p ) +{ + SbxValues aTmp; + BYTE nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + if( p->nChar > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (BYTE) p->nChar; + break; + case SbxBYTE: + nRes = (BYTE) p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + if( p->nInteger > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else if( p->nInteger < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (BYTE) p->nInteger; + break; + case SbxERROR: + case SbxUSHORT: + if( p->nUShort > (USHORT) SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else + nRes = (BYTE) p->nUShort; + break; + case SbxLONG: + if( p->nLong > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else if( p->nLong < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (BYTE) p->nLong; + break; + case SbxULONG: + if( p->nULong > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else + nRes = (BYTE) p->nULong; + break; + case SbxSALINT64: + if( p->nInt64 > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else if( p->nInt64 < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (BYTE) p->nInt64; + break; + case SbxSALUINT64: + if( p->uInt64 > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else + nRes = (BYTE) p->uInt64; + break; + case SbxSINGLE: + if( p->nSingle > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else if( p->nSingle < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (BYTE) ImpRound( p->nSingle ); + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else if( p->eType == SbxDECIMAL ) + { + dVal = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( dVal ); + } + else + dVal = p->nDouble; + + if( dVal > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else if( dVal < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (BYTE) ImpRound( dVal ); + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; + } + else if( d < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (BYTE) ( d + 0.5 ); + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetByte(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxBYTE: + nRes = p->nByte; break; + + // ab hier wird getestet + case SbxBYREF | SbxCHAR: + aTmp.nChar = *p->pChar; goto ref; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + aTmp.nInteger = *p->pInteger; goto ref; + case SbxBYREF | SbxLONG: + aTmp.nLong = *p->pLong; goto ref; + case SbxBYREF | SbxULONG: + aTmp.nULong = *p->pULong; goto ref; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + aTmp.nUShort = *p->pUShort; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutByte( SbxValues* p, BYTE n ) +{ + switch( +p->eType ) + { + case SbxBYTE: + p->nByte = n; break; + case SbxINTEGER: + case SbxBOOL: + p->nInteger = n; break; + case SbxERROR: + case SbxUSHORT: + p->nUShort = n; break; + case SbxLONG: + p->nLong = n; break; + case SbxULONG: + p->nULong = n; break; + case SbxSINGLE: + p->nSingle = n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + case SbxSALINT64: + p->nInt64 = n; break; + case SbxSALUINT64: + p->uInt64 = n; break; + case SbxULONG64: + p->nULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxLONG64: + p->nLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxCURRENCY: + p->nLong64 = ImpDoubleToCurrency( (double)n ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + ImpCreateDecimal( p )->setByte( n ); + break; + + case SbxCHAR: + p->nChar = (xub_Unicode) n; break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + ImpCvtNum( (double) n, 0, *p->pString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutByte( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + *p->pByte = n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + *p->pInteger = n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + *p->pUShort = n; break; + case SbxBYREF | SbxLONG: + *p->pLong = n; break; + case SbxBYREF | SbxULONG: + *p->pULong = n; break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = n; break; + case SbxBYREF | SbxULONG64: + *p->pULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxBYREF | SbxLONG64: + *p->pLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = n; break; + case SbxBYREF | SbxCURRENCY: + *p->pLong64 = ImpDoubleToCurrency( (double)n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxchar.cxx b/bf_basic/source/sbx/sbxchar.cxx new file mode 100644 index 00000000000..23d004b2ab1 --- /dev/null +++ b/bf_basic/source/sbx/sbxchar.cxx @@ -0,0 +1,323 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +xub_Unicode ImpGetChar( const SbxValues* p ) +{ + SbxValues aTmp; + xub_Unicode nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = (xub_Unicode) p->nByte; + break; + case SbxINTEGER: + case SbxBOOL: + if( p->nInteger < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINCHAR; + } + else + nRes = (xub_Unicode) p->nInteger; + break; + case SbxERROR: + case SbxUSHORT: + nRes = (xub_Unicode) p->nUShort; + break; + case SbxLONG: + if( p->nLong > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXCHAR; + } + else if( p->nLong < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINCHAR; + } + else + nRes = (xub_Unicode) p->nLong; + break; + case SbxULONG: + if( p->nULong > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXCHAR; + } + else + nRes = (xub_Unicode) p->nULong; + break; + case SbxSALINT64: + if( p->nInt64 > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXCHAR; + } + else if( p->nInt64 < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINCHAR; + } + else + nRes = (xub_Unicode) p->nInt64; + break; + case SbxSALUINT64: + if( p->uInt64 > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXCHAR; + } + else + nRes = (xub_Unicode) p->uInt64; + break; + case SbxSINGLE: + if( p->nSingle > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXCHAR; + } + else if( p->nSingle < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINCHAR; + } + else + nRes = (xub_Unicode) ImpRound( p->nSingle ); + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else if( p->eType == SbxDECIMAL ) + { + dVal = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( dVal ); + } + else + dVal = p->nDouble; + + if( dVal > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXCHAR; + } + else if( dVal < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINCHAR; + } + else + nRes = (BYTE) ImpRound( dVal ); + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXCHAR; + } + else if( d < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINCHAR; + } + else + nRes = (xub_Unicode) ImpRound( d ); + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetChar(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + // ab hier wird getestet + case SbxBYREF | SbxBYTE: + aTmp.nByte = *p->pByte; goto ref; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + aTmp.nInteger = *p->pInteger; goto ref; + case SbxBYREF | SbxLONG: + aTmp.nLong = *p->pLong; goto ref; + case SbxBYREF | SbxULONG: + aTmp.nULong = *p->pULong; goto ref; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + aTmp.nUShort = *p->pUShort; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutChar( SbxValues* p, xub_Unicode n ) +{ + SbxValues aTmp; +start: + switch( +p->eType ) + { + case SbxCHAR: + p->nChar = n; break; + case SbxINTEGER: + case SbxBOOL: + p->nInteger = n; break; + case SbxLONG: + p->nLong = n; break; + case SbxSINGLE: + p->nSingle = n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + case SbxSALINT64: + p->nInt64 = n; break; + case SbxSALUINT64: + p->uInt64 = n; break; + case SbxULONG64: + p->nULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxLONG64: + p->nLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxCURRENCY: + p->nLong64 = ImpDoubleToCurrency( (double)n ); break; + case SbxBYREF | SbxDECIMAL: + ImpCreateDecimal( p )->setChar( n ); + break; + + // ab hier wird getestet + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + *p->pString = n; + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutChar( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + *p->pChar = n; break; + case SbxBYREF | SbxBYTE: + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + *p->pInteger = n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + *p->pLong = (INT32) n; break; + case SbxBYREF | SbxULONG: + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = (float) n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = n; break; + case SbxBYREF | SbxULONG64: + *p->pULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxBYREF | SbxLONG64: + *p->pLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxBYREF | SbxCURRENCY: + *p->pLong64 = ImpDoubleToCurrency( (double)n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxcoll.cxx b/bf_basic/source/sbx/sbxcoll.cxx new file mode 100644 index 00000000000..37cafe1866a --- /dev/null +++ b/bf_basic/source/sbx/sbxcoll.cxx @@ -0,0 +1,293 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "sbx.hxx" +#include "sbxres.hxx" + +namespace binfilter { + +TYPEINIT1(SbxCollection,SbxObject) +TYPEINIT1(SbxStdCollection,SbxCollection) + +static const char* pCount; +static const char* pAdd; +static const char* pItem; +static const char* pRemove; +static USHORT nCountHash = 0, nAddHash, nItemHash, nRemoveHash; + +///////////////////////////////////////////////////////////////////////// + +SbxCollection::SbxCollection( const XubString& rClass ) + : SbxObject( rClass ) +{ + if( !nCountHash ) + { + pCount = GetSbxRes( STRING_COUNTPROP ); + pAdd = GetSbxRes( STRING_ADDMETH ); + pItem = GetSbxRes( STRING_ITEMMETH ); + pRemove = GetSbxRes( STRING_REMOVEMETH ); + nCountHash = MakeHashCode( String::CreateFromAscii( pCount ) ); + nAddHash = MakeHashCode( String::CreateFromAscii( pAdd ) ); + nItemHash = MakeHashCode( String::CreateFromAscii( pItem ) ); + nRemoveHash = MakeHashCode( String::CreateFromAscii( pRemove ) ); + } + Initialize(); + // Fuer Zugriffe auf sich selbst + StartListening( GetBroadcaster(), TRUE ); +} + +SbxCollection::SbxCollection( const SbxCollection& rColl ) + : SvRefBase( rColl ), SbxObject( rColl ) +{} + +SbxCollection& SbxCollection::operator=( const SbxCollection& r ) +{ + if( &r != this ) + SbxObject::operator=( r ); + return *this; +} + +SbxCollection::~SbxCollection() +{} + +void SbxCollection::Clear() +{ + SbxObject::Clear(); + Initialize(); +} + +void SbxCollection::Initialize() +{ + SetType( SbxOBJECT ); + SetFlag( SBX_FIXED ); + ResetFlag( SBX_WRITE ); + SbxVariable* p; + p = Make( String::CreateFromAscii( pCount ), SbxCLASS_PROPERTY, SbxINTEGER ); + p->ResetFlag( SBX_WRITE ); + p->SetFlag( SBX_DONTSTORE ); + p = Make( String::CreateFromAscii( pAdd ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p = Make( String::CreateFromAscii( pItem ), SbxCLASS_METHOD, SbxOBJECT ); + p->SetFlag( SBX_DONTSTORE ); + p = Make( String::CreateFromAscii( pRemove ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); +} + +SbxVariable* SbxCollection::FindUserData( UINT32 nData ) +{ + if( GetParameters() ) + { + SbxObject* pObj = (SbxObject*) GetObject(); + return pObj ? pObj->FindUserData( nData ) : NULL; + } + else + return SbxObject::FindUserData( nData ); +} + +SbxVariable* SbxCollection::Find( const XubString& rName, SbxClassType t ) +{ + if( GetParameters() ) + { + SbxObject* pObj = (SbxObject*) GetObject(); + return pObj ? pObj->Find( rName, t ) : NULL; + } + else + return SbxObject::Find( rName, t ); +} + +void SbxCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1, + const SfxHint& rHint, const TypeId& rId2 ) +{ + const SbxHint* p = PTR_CAST(SbxHint,&rHint); + if( p ) + { + ULONG nId = p->GetId(); + BOOL bRead = BOOL( nId == SBX_HINT_DATAWANTED ); + BOOL bWrite = BOOL( nId == SBX_HINT_DATACHANGED ); + SbxVariable* pVar = p->GetVar(); + SbxArray* pArg = pVar->GetParameters(); + if( bRead || bWrite ) + { + XubString aVarName( pVar->GetName() ); + if( pVar == this ) + CollItem( pArg ); + else if( pVar->GetHashCode() == nCountHash + && aVarName.EqualsIgnoreCaseAscii( pCount ) ) + pVar->PutLong( pObjs->Count() ); + else if( pVar->GetHashCode() == nAddHash + && aVarName.EqualsIgnoreCaseAscii( pAdd ) ) + CollAdd( pArg ); + else if( pVar->GetHashCode() == nItemHash + && aVarName.EqualsIgnoreCaseAscii( pItem ) ) + CollItem( pArg ); + else if( pVar->GetHashCode() == nRemoveHash + && aVarName.EqualsIgnoreCaseAscii( pRemove ) ) + CollRemove( pArg ); + else + SbxObject::SFX_NOTIFY( rCst, rId1, rHint, rId2 ); + return; + } + } + SbxObject::SFX_NOTIFY( rCst, rId1, rHint, rId2 ); +} + +// Default: Argument ist Objekt + +void SbxCollection::CollAdd( SbxArray* pPar_ ) +{ + if( pPar_->Count() != 2 ) + SetError( SbxERR_WRONG_ARGS ); + else + { + SbxBase* pObj = pPar_->Get( 1 )->GetObject(); + if( !pObj || !( pObj->ISA(SbxObject) ) ) + SetError( SbxERR_NOTIMP ); + else + Insert( (SbxObject*) pObj ); + } +} + +// Default: Index ab 1 oder der Objektname + +void SbxCollection::CollItem( SbxArray* pPar_ ) +{ + if( pPar_->Count() != 2 ) + SetError( SbxERR_WRONG_ARGS ); + else + { + SbxVariable* pRes = NULL; + SbxVariable* p = pPar_->Get( 1 ); + if( p->GetType() == SbxSTRING ) + pRes = Find( p->GetString(), SbxCLASS_OBJECT ); + else + { + short n = p->GetInteger(); + if( n >= 1 && n <= (short) pObjs->Count() ) + pRes = pObjs->Get( (USHORT) n - 1 ); + } + if( !pRes ) + SetError( SbxERR_BAD_INDEX ); + pPar_->Get( 0 )->PutObject( pRes ); + } +} + +// Default: Index ab 1 + +void SbxCollection::CollRemove( SbxArray* pPar_ ) +{ + if( pPar_->Count() != 2 ) + SetError( SbxERR_WRONG_ARGS ); + else + { + short n = pPar_->Get( 1 )->GetInteger(); + if( n < 1 || n > (short) pObjs->Count() ) + SetError( SbxERR_BAD_INDEX ); + else + Remove( pObjs->Get( (USHORT) n - 1 ) ); + } +} + +BOOL SbxCollection::LoadData( SvStream& rStrm, USHORT nVer ) +{ + BOOL bRes = SbxObject::LoadData( rStrm, nVer ); + Initialize(); + return bRes; +} + +///////////////////////////////////////////////////////////////////////// + +SbxStdCollection::SbxStdCollection + ( const XubString& rClass, const XubString& rElem, BOOL b ) + : SbxCollection( rClass ), aElemClass( rElem ), + bAddRemoveOk( b ) +{} + +SbxStdCollection::SbxStdCollection( const SbxStdCollection& r ) + : SvRefBase( r ), SbxCollection( r ), + aElemClass( r.aElemClass ), bAddRemoveOk( r.bAddRemoveOk ) +{} + +SbxStdCollection& SbxStdCollection::operator=( const SbxStdCollection& r ) +{ + if( &r != this ) + { + if( !r.aElemClass.EqualsIgnoreCaseAscii( aElemClass ) ) + SetError( SbxERR_CONVERSION ); + else + SbxCollection::operator=( r ); + } + return *this; +} + +SbxStdCollection::~SbxStdCollection() +{} + +// Default: Fehler, wenn falsches Objekt + +void SbxStdCollection::Insert( SbxVariable* p ) +{ + SbxObject* pObj = PTR_CAST(SbxObject,p); + if( pObj && !pObj->IsClass( aElemClass ) ) + SetError( SbxERR_BAD_ACTION ); + else + SbxCollection::Insert( p ); +} + +void SbxStdCollection::CollAdd( SbxArray* pPar_ ) +{ + if( !bAddRemoveOk ) + SetError( SbxERR_BAD_ACTION ); + else + SbxCollection::CollAdd( pPar_ ); +} + +void SbxStdCollection::CollRemove( SbxArray* pPar_ ) +{ + if( !bAddRemoveOk ) + SetError( SbxERR_BAD_ACTION ); + else + SbxCollection::CollRemove( pPar_ ); +} + +BOOL SbxStdCollection::LoadData( SvStream& rStrm, USHORT nVer ) +{ + BOOL bRes = SbxCollection::LoadData( rStrm, nVer ); + if( bRes ) + { + rStrm.ReadByteString( aElemClass, RTL_TEXTENCODING_ASCII_US ); + rStrm >> bAddRemoveOk; + } + return bRes; +} + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxconv.hxx b/bf_basic/source/sbx/sbxconv.hxx new file mode 100644 index 00000000000..3e32584ddda --- /dev/null +++ b/bf_basic/source/sbx/sbxconv.hxx @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SBXCONV_HXX +#define _SBXCONV_HXX + +#include "sbxdec.hxx" + +namespace binfilter { + +class SbxINT64Converter +{ +public: + static BigInt SbxINT64_2_BigInt( const SbxINT64 &r ); + static BOOL BigInt_2_SbxINT64( const BigInt& b, SbxINT64 *p ); + static BigInt SbxUINT64_2_BigInt( const SbxUINT64 &r ); + static BOOL BigInt_2_SbxUINT64( const BigInt& b, SbxUINT64 *p ); +}; + +// SBXSCAN.CXX +extern void ImpCvtNum( double nNum, short nPrec, String& rRes, BOOL bCoreString=FALSE ); +extern SbxError ImpScan + ( const String& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen, + BOOL bAllowIntntl=FALSE, BOOL bOnlyIntntl=FALSE ); + +// SBXINT.CXX + +double ImpRound( double ); +INT16 ImpGetInteger( const SbxValues* ); +void ImpPutInteger( SbxValues*, INT16 ); +sal_Int64 ImpGetInt64( const SbxValues* ); +void ImpPutInt64( SbxValues*, sal_Int64 ); +sal_uInt64 ImpGetUInt64( const SbxValues* ); +void ImpPutUInt64( SbxValues*, sal_uInt64 ); + +sal_Int64 ImpDoubleToSalInt64( double d ); +sal_uInt64 ImpDoubleToSalUInt64( double d ); +double ImpSalUInt64ToDouble( sal_uInt64 n ); + +// SBXLNG.CXX + +INT32 ImpGetLong( const SbxValues* ); +void ImpPutLong( SbxValues*, INT32 ); + +// SBXSNG.CXX + +float ImpGetSingle( const SbxValues* ); +void ImpPutSingle( SbxValues*, float ); + +// SBXDBL.CXX + +double ImpGetDouble( const SbxValues* ); +void ImpPutDouble( SbxValues*, double, BOOL bCoreString=FALSE ); + +#if FALSE +// SBX64.CXX + +SbxINT64 ImpGetINT64( const SbxValues* ); +void ImpPutINT64( SbxValues*, const SbxINT64& ); +SbxUINT64 ImpGetUINT64( const SbxValues* ); +void ImpPutUINT64( SbxValues*, const SbxUINT64& ); +#endif + +// SBXCURR.CXX + +SbxUINT64 ImpDoubleToUINT64( double ); +double ImpUINT64ToDouble( const SbxUINT64& ); +SbxINT64 ImpDoubleToINT64( double ); +double ImpINT64ToDouble( const SbxINT64& ); + +#if TRUE +INT32 ImpGetCurrLong( const SbxValues* ); +void ImpPutCurrLong( SbxValues*, INT32 ); +INT32 ImpDoubleToCurrLong( double ); +double ImpCurrLongToDouble( INT32 ); +#endif + +SbxINT64 ImpGetCurrency( const SbxValues* ); +void ImpPutCurrency( SbxValues*, const SbxINT64& ); +inline +SbxINT64 ImpDoubleToCurrency( double d ) + { return ImpDoubleToINT64( d * CURRENCY_FACTOR ); } +inline +double ImpCurrencyToDouble( const SbxINT64 &r ) + { return ImpINT64ToDouble( r ) / CURRENCY_FACTOR; } + + +// SBXDEC.CXX + +SbxDecimal* ImpCreateDecimal( SbxValues* p ); +SbxDecimal* ImpGetDecimal( const SbxValues* p ); +void ImpPutDecimal( SbxValues* p, SbxDecimal* pDec ); + +// SBXDATE.CXX + +double ImpGetDate( const SbxValues* ); +void ImpPutDate( SbxValues*, double ); + +// SBXSTR.CXX + +String ImpGetString( const SbxValues* ); +String ImpGetCoreString( const SbxValues* ); +void ImpPutString( SbxValues*, const String* ); + +// SBXCHAR.CXX + +sal_Unicode ImpGetChar( const SbxValues* ); +void ImpPutChar( SbxValues*, sal_Unicode ); + +// SBXBYTE.CXX +BYTE ImpGetByte( const SbxValues* ); +void ImpPutByte( SbxValues*, BYTE ); + +// SBXUINT.CXX + +UINT16 ImpGetUShort( const SbxValues* ); +void ImpPutUShort( SbxValues*, UINT16 ); + +// SBXULNG.CXX + +UINT32 ImpGetULong( const SbxValues* ); +void ImpPutULong( SbxValues*, UINT32 ); + +// SBXBOOL.CXX + +enum SbxBOOL ImpGetBool( const SbxValues* ); +void ImpPutBool( SbxValues*, INT16 ); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxcurr.cxx b/bf_basic/source/sbx/sbxcurr.cxx new file mode 100644 index 00000000000..1355ce0a17e --- /dev/null +++ b/bf_basic/source/sbx/sbxcurr.cxx @@ -0,0 +1,398 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sbx.hxx" + +#include + +#define _TLBIGINT_INT64 +#include + +#include "sbxvar.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +static String ImpCurrencyToString( const SbxINT64& ); +static SbxINT64 ImpStringToCurrency( const String& ); + +SbxINT64 ImpGetCurrency( const SbxValues* p ) +{ + SbxValues aTmp; + SbxINT64 nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes.SetNull(); break; + case SbxCHAR: + nRes = ImpDoubleToCurrency( (double)p->nChar ); break; + case SbxBYTE: + nRes = ImpDoubleToCurrency( (double)p->nByte ); break; + case SbxINTEGER: + case SbxBOOL: + nRes = ImpDoubleToCurrency( (double)p->nInteger ); break; + case SbxERROR: + case SbxUSHORT: + nRes = ImpDoubleToCurrency( (double)p->nUShort ); break; + case SbxCURRENCY: + nRes = p->nLong64; break; + case SbxLONG: + nRes = ImpDoubleToCurrency( (double)p->nLong ); + break; + case SbxULONG: + nRes = ImpDoubleToCurrency( (double)p->nULong ); + break; + case SbxSALINT64: + nRes = ImpDoubleToCurrency( (double)p->nInt64 ); + break; + case SbxSALUINT64: + nRes = ImpDoubleToCurrency( ImpSalUInt64ToDouble( p->uInt64 ) ); + break; + case SbxSINGLE: + if( p->nSingle > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes.SetMax(); + } + else if( p->nSingle < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes.SetMin(); + } + else + nRes = ImpDoubleToCurrency( (double)p->nSingle ); + break; + case SbxDATE: + case SbxDOUBLE: + if( p->nDouble > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes.SetMax(); + } + else if( p->nDouble < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes.SetMin(); + } + else + nRes = ImpDoubleToCurrency( p->nDouble ); + break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double d = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( d ); + if( d > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes.SetMax(); + } + else if( d < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes.SetMin(); + } + else + nRes = ImpDoubleToCurrency( d ); + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes.SetNull(); + else + nRes = ImpStringToCurrency( *p->pString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetCurrency(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes.SetNull(); + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = ImpDoubleToCurrency( (double)*p->pChar ); break; + case SbxBYREF | SbxBYTE: + nRes = ImpDoubleToCurrency( (double)*p->pByte ); break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = ImpDoubleToCurrency( (double)*p->pInteger ); break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + nRes = ImpDoubleToCurrency( (double)*p->pUShort ); break; + case SbxBYREF | SbxCURRENCY: + nRes = *p->pLong64; break; + + // ab hier muss getestet werden + case SbxBYREF | SbxLONG: + aTmp.nLong = *p->pLong; goto ref; + case SbxBYREF | SbxULONG: + aTmp.nULong = *p->pULong; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes.SetNull(); + } + return nRes; +} + +void ImpPutCurrency( SbxValues* p, const SbxINT64 &r ) +{ + double dVal = ImpCurrencyToDouble( r ); + SbxValues aTmp; +start: + switch( +p->eType ) + { + // Hier sind Tests notwendig + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxLONG: + aTmp.pLong = &p->nLong; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // ab hier nicht mehr + case SbxSINGLE: + p->nSingle = (float)dVal; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = dVal; break; + case SbxSALINT64: + p->nInt64 = ImpDoubleToSalInt64( dVal ); break; + case SbxSALUINT64: + p->uInt64 = ImpDoubleToSalUInt64( dVal ); break; + case SbxCURRENCY: + p->nLong64 = r; break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + SbxDecimal* pDec = ImpCreateDecimal( p ); + if( !pDec->setDouble( dVal ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + + *p->pString = ImpCurrencyToString( r ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutCurrency( r ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( dVal > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMAXCHAR; + } + else if( dVal < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMINCHAR; + } + *p->pChar = (xub_Unicode) dVal; break; + case SbxBYREF | SbxBYTE: + if( dVal > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMAXBYTE; + } + else if( dVal < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = 0; + } + *p->pByte = (BYTE) dVal; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( dVal > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMAXINT; + } + else if( dVal < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMININT; + } + *p->pInteger = (INT16) dVal; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( dVal > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMAXUINT; + } + else if( dVal < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = 0; + } + *p->pUShort = (UINT16) dVal; break; + case SbxBYREF | SbxLONG: + if( dVal > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMAXLNG; + } + else if( dVal < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMINLNG; + } + *p->pLong = (INT32) dVal; break; + case SbxBYREF | SbxULONG: + if( dVal > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = SbxMAXULNG; + } + else if( dVal < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); dVal = 0; + } + *p->pULong = (UINT32) dVal; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = ImpDoubleToSalInt64( dVal ); break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = ImpDoubleToSalUInt64( dVal ); break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = (float) dVal; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) dVal; break; + case SbxBYREF | SbxCURRENCY: + *p->pLong64 = r; break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +// Hilfs-Funktionen zur Wandlung + +static String ImpCurrencyToString( const SbxINT64 &r ) +{ + BigInt a10000 = 10000; + + BigInt aInt( SbxINT64Converter::SbxINT64_2_BigInt( r ) ); + aInt.Abs(); + BigInt aFrac = aInt; + aInt /= a10000; + aFrac %= a10000; + aFrac += a10000; + + String aString; + if( r.nHigh < 0 ) + aString = '-'; + aString += aInt.GetString(); + aString += '.'; + aString += aFrac.GetString().GetBuffer()+1; + return aString; +} + +static SbxINT64 ImpStringToCurrency( const String &r ) +{ + int nDec = 4; + String aStr; + const sal_Unicode* p = r.GetBuffer(); + + if( *p == '-' ) + aStr += *p++; + + while( *p >= '0' && *p <= '9' ) { + aStr += *p++; + if( *p == ',' ) + p++; + } + + if( *p == '.' ) { + p++; + while( nDec && *p >= '0' && *p <= '9' ) { + aStr += *p++; + nDec--; + } + } + while( nDec ) { + aStr += '0'; + nDec--; + } + + BigInt aBig( aStr ); + SbxINT64 nRes; + SbxINT64Converter::BigInt_2_SbxINT64( aBig, &nRes ); + return nRes; +} + +double ImpINT64ToDouble( const SbxINT64 &r ) +{ return (double)r.nHigh*(double)4294967296.0 + (double)r.nLow; } + +SbxINT64 ImpDoubleToINT64( double d ) +{ + SbxINT64 nRes; + nRes.Set( d ); + return nRes; +} + +double ImpUINT64ToDouble( const SbxUINT64 &r ) +{ return (double)r.nHigh*(double)4294967296.0 + (double)r.nLow; } + +SbxUINT64 ImpDoubleToUINT64( double d ) +{ + SbxUINT64 nRes; + nRes.Set( d ); + return nRes; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxdate.cxx b/bf_basic/source/sbx/sbxdate.cxx new file mode 100644 index 00000000000..e205df5d873 --- /dev/null +++ b/bf_basic/source/sbx/sbxdate.cxx @@ -0,0 +1,416 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include +#include +#include +#include "sbx.hxx" +#include "sbxconv.hxx" +#include "math.h" + +#include + +namespace binfilter { + +double ImpGetDate( const SbxValues* p ) +{ + double nRes; + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger; break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; break; + case SbxLONG: + nRes = (double) p->nLong; break; + case SbxULONG: + nRes = (double) p->nULong; break; + case SbxSINGLE: + nRes = p->nSingle; break; + case SbxDATE: + case SbxDOUBLE: + nRes = p->nDouble; break; + case SbxULONG64: + nRes = ImpUINT64ToDouble( p->nULong64 ); break; + case SbxLONG64: + nRes = ImpINT64ToDouble( p->nLong64 ); break; + case SbxCURRENCY: + nRes = ImpCurrencyToDouble( p->nLong64 ); break; + case SbxSALINT64: + nRes = static_cast< double >(p->nInt64); break; + case SbxSALUINT64: + nRes = ImpSalUInt64ToDouble( p->uInt64 ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + if( p->pDecimal ) + p->pDecimal->getDouble( nRes ); + else + nRes = 0.0; + break; + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { +#ifndef DOS + LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); + + SvNumberFormatter* pFormatter; + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > + xFactory = comphelper::getProcessServiceFactory(); + pFormatter = new SvNumberFormatter( xFactory, eLangType ); + + sal_uInt32 nIndex; + xub_StrLen nCheckPos = 0; + short nType = 127; + + // Standard-Vorlagen des Formatters haben nur zweistellige + // Jahreszahl. Deshalb eigenes Format registrieren + + // HACK, da der Numberformatter in PutandConvertEntry die Platzhalter + // fuer Monat, Tag, Jahr nicht entsprechend der Systemeinstellung + // austauscht. Problem: Print Year(Date) unter engl. BS + // siehe auch basic\source\runtime\runtime.cxx + + SvtSysLocale aSysLocale; + DateFormat eDate = aSysLocale.GetLocaleData().getDateFormat(); + String aDateStr; + switch( eDate ) + { + case MDY: aDateStr.AssignAscii( "MM.TT.JJJJ" ); break; + case DMY: aDateStr.AssignAscii( "TT.MM.JJJJ" ); break; + case YMD: aDateStr.AssignAscii( "JJJJ.MM.TT" ); break; + default: aDateStr.AssignAscii( "MM.TT.JJJJ" ); + } + + String aStr( aDateStr ); + aStr.AppendAscii( " HH:MM:SS" ); + + pFormatter->PutandConvertEntry( aStr, nCheckPos, nType, + nIndex, LANGUAGE_GERMAN, eLangType ); + BOOL bSuccess = pFormatter->IsNumberFormat( *p->pString, nIndex, nRes ); + if ( bSuccess ) + { + short nType_ = pFormatter->GetType( nIndex ); + if(!(nType_ & ( NUMBERFORMAT_DATETIME | NUMBERFORMAT_DATE | + NUMBERFORMAT_TIME | NUMBERFORMAT_DEFINED ))) + bSuccess = FALSE; + } + + if ( !bSuccess ) + { + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + + delete pFormatter; +#else + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; +#endif + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetDate(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger; break; + case SbxBYREF | SbxLONG: + nRes = *p->pLong; break; + case SbxBYREF | SbxULONG: + nRes = *p->pULong; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + nRes = *p->pUShort; break; + case SbxBYREF | SbxSINGLE: + nRes = *p->pSingle; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + nRes = *p->pDouble; break; + case SbxBYREF | SbxULONG64: + nRes = ImpUINT64ToDouble( *p->pULong64 ); break; + case SbxBYREF | SbxLONG64: + nRes = ImpINT64ToDouble( *p->pLong64 ); break; + case SbxBYREF | SbxCURRENCY: + nRes = ImpCurrencyToDouble( *p->pLong64 ); break; + case SbxBYREF | SbxSALINT64: + nRes = static_cast< double >(*p->pnInt64); break; + case SbxBYREF | SbxSALUINT64: + nRes = ImpSalUInt64ToDouble( *p->puInt64 ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutDate( SbxValues* p, double n ) +{ + SbxValues aTmp; + +start: + switch( +p->eType ) + { + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + + // ab hier wird getestet + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxLONG: + aTmp.pLong = &p->nLong; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxSINGLE: + aTmp.pSingle = &p->nSingle; goto direct; + case SbxULONG64: + aTmp.pULong64 = &p->nULong64; goto direct; + case SbxLONG64: + case SbxCURRENCY: + aTmp.pLong64 = &p->nLong64; goto direct; + case SbxSALINT64: + aTmp.pnInt64 = &p->nInt64; goto direct; + case SbxSALUINT64: + aTmp.puInt64 = &p->uInt64; goto direct; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + SbxDecimal* pDec = ImpCreateDecimal( p ); + if( !pDec->setDouble( n ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + break; + } + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: +#ifndef DOS + { + if( !p->pString ) + p->pString = new XubString; + Color* pColor; + + LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); + SvNumberFormatter* pFormatter; + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > + xFactory = comphelper::getProcessServiceFactory(); + pFormatter = new SvNumberFormatter( xFactory, eLangType ); + + sal_uInt32 nIndex; + xub_StrLen nCheckPos = 0; + short nType; + + SvtSysLocale aSysLocale; + DateFormat eDate = aSysLocale.GetLocaleData().getDateFormat(); + String aStr; + // ist der ganzzahlige Teil 0, wollen wir kein Jahr! + if( n <= -1.0 || n >= 1.0 ) + { + // Time only if != 00:00:00 + if( floor( n ) == n ) + { + switch( eDate ) + { + case MDY: aStr.AssignAscii( "MM.TT.JJJJ" ); break; + case DMY: aStr.AssignAscii( "TT.MM.JJJJ" ); break; + case YMD: aStr.AssignAscii( "JJJJ.MM.TT" ); break; + default: aStr.AssignAscii( "MM.TT.JJJJ" ); + } + } + else + { + switch( eDate ) + { + case MDY: aStr.AssignAscii( "MM.TT.JJJJ HH:MM:SS" ); break; + case DMY: aStr.AssignAscii( "TT.MM.JJJJ HH:MM:SS" ); break; + case YMD: aStr.AssignAscii( "JJJJ.MM.TT HH:MM:SS" ); break; + default: aStr.AssignAscii( "MM.TT.JJJJ HH:MM:SS" ); + } + } + } + else + aStr.AppendAscii( "HH:MM:SS" ); + + pFormatter->PutandConvertEntry( aStr, + nCheckPos, + nType, + nIndex, + LANGUAGE_GERMAN, + eLangType ); + pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor ); + delete pFormatter; +#endif + break; +#ifndef DOS + } +#endif + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutDate( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR; + } + else if( n < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR; + } + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + else if( n < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + if( n > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG; + } + else if( n < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG; + } + *p->pLong = (INT32) n; break; + case SbxBYREF | SbxULONG: + if( n > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXULNG; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSINGLE: + if( n > SbxMAXSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXSNG; + } + else if( n < SbxMINSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINSNG; + } + *p->pSingle = (float) n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = ImpDoubleToSalInt64( n ); break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = ImpDoubleToSalUInt64( n ); break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) n; break; + case SbxBYREF | SbxCURRENCY: + if( n > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCURR; + } + else if( n < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCURR; + } + *p->pLong64 = ImpDoubleToCurrency( n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxdbl.cxx b/bf_basic/source/sbx/sbxdbl.cxx new file mode 100644 index 00000000000..e8d12d96b10 --- /dev/null +++ b/bf_basic/source/sbx/sbxdbl.cxx @@ -0,0 +1,301 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +double ImpGetDouble( const SbxValues* p ) +{ + double nRes; + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger; break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; break; + case SbxLONG: + nRes = p->nLong; break; + case SbxULONG: + nRes = p->nULong; break; + case SbxSINGLE: + nRes = p->nSingle; break; + case SbxDATE: + case SbxDOUBLE: + nRes = p->nDouble; break; + case SbxCURRENCY: + nRes = ImpCurrencyToDouble( p->nLong64 ); break; + case SbxSALINT64: + nRes = static_cast< double >(p->nInt64); break; + case SbxSALUINT64: + nRes = ImpSalUInt64ToDouble( p->uInt64 ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + if( p->pDecimal ) + p->pDecimal->getDouble( nRes ); + else + nRes = 0.0; + break; + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else + nRes = d; + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetDouble(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger; break; + case SbxBYREF | SbxLONG: + nRes = *p->pLong; break; + case SbxBYREF | SbxULONG: + nRes = *p->pULong; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + nRes = *p->pUShort; break; + case SbxBYREF | SbxSINGLE: + nRes = *p->pSingle; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + nRes = *p->pDouble; break; + case SbxBYREF | SbxCURRENCY: + nRes = ImpCurrencyToDouble( *p->pLong64 ); break; + case SbxBYREF | SbxSALINT64: + nRes = static_cast< double >(*p->pnInt64); break; + case SbxBYREF | SbxSALUINT64: + nRes = ImpSalUInt64ToDouble( *p->puInt64 ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutDouble( SbxValues* p, double n, BOOL bCoreString ) +{ + SbxValues aTmp; +start: + switch( +p->eType ) + { + // Hier sind Tests notwendig + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxLONG: + case SbxCURRENCY: + aTmp.pLong = &p->nLong; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxSINGLE: + aTmp.pSingle = &p->nSingle; goto direct; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + SbxDecimal* pDec = ImpCreateDecimal( p ); + if( !pDec->setDouble( n ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + break; + } + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // ab hier nicht mehr + case SbxSALINT64: + p->nInt64 = ImpDoubleToSalInt64( n ); break; + case SbxSALUINT64: + p->uInt64 = ImpDoubleToSalUInt64( n ); break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + ImpCvtNum( (double) n, 14, *p->pString, bCoreString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutDouble( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR; + } + else if( n < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR; + } + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + else if( n < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + if( n > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG; + } + else if( n < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG; + } + *p->pLong = (INT32) n; break; + case SbxBYREF | SbxULONG: + if( n > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXULNG; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSINGLE: + if( n > SbxMAXSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXSNG; + } + else if( n < SbxMINSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINSNG; + } + else if( n > 0 && n < SbxMAXSNG2 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXSNG2; + } + else if( n < 0 && n > SbxMINSNG2 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINSNG2; + } + *p->pSingle = (float) n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = ImpDoubleToSalInt64( n ); break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = ImpDoubleToSalUInt64( n ); break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) n; break; + case SbxBYREF | SbxCURRENCY: + if( n > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCURR; + } + else if( n < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCURR; + } + *p->pLong64 = ImpDoubleToCurrency( n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxdec.cxx b/bf_basic/source/sbx/sbxdec.cxx new file mode 100644 index 00000000000..24527af1369 --- /dev/null +++ b/bf_basic/source/sbx/sbxdec.cxx @@ -0,0 +1,731 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "sbx.hxx" +#include "sbxconv.hxx" + +#include + +namespace binfilter { + +#ifdef WIN32 +SbxDecimal::SbxDecimal( void ) +{ + setInt( 0 ); + mnRefCount = 0; +} +#endif + +SbxDecimal::SbxDecimal( const SbxDecimal& rDec ) +{ +#ifdef WIN32 + maDec = rDec.maDec; +#else + (void)rDec; +#endif + mnRefCount = 0; +} + +SbxDecimal::~SbxDecimal() { } + +void releaseDecimalPtr( SbxDecimal*& rpDecimal ) +{ + if( rpDecimal ) + { + rpDecimal->mnRefCount--; + if( rpDecimal->mnRefCount == 0 ) + { + delete rpDecimal; + rpDecimal = NULL; + } + } +} + +#ifdef WIN32 + +bool SbxDecimal::operator -= ( const SbxDecimal &r ) +{ + HRESULT hResult = VarDecSub( &maDec, (LPDECIMAL)&r.maDec, &maDec ); + bool bRet = ( hResult == S_OK ); + return bRet; +} + +bool SbxDecimal::operator += ( const SbxDecimal &r ) +{ + HRESULT hResult = VarDecAdd( &maDec, (LPDECIMAL)&r.maDec, &maDec ); + bool bRet = ( hResult == S_OK ); + return bRet; +} + +bool SbxDecimal::operator /= ( const SbxDecimal &r ) +{ + HRESULT hResult = VarDecDiv( &maDec, (LPDECIMAL)&r.maDec, &maDec ); + bool bRet = ( hResult == S_OK ); + return bRet; +} + +bool SbxDecimal::operator *= ( const SbxDecimal &r ) +{ + HRESULT hResult = VarDecMul( &maDec, (LPDECIMAL)&r.maDec, &maDec ); + bool bRet = ( hResult == S_OK ); + return bRet; +} + +bool SbxDecimal::neg( void ) +{ + HRESULT hResult = VarDecNeg( &maDec, &maDec ); + bool bRet = ( hResult == S_OK ); + return bRet; +} + +bool SbxDecimal::isZero( void ) +{ + SbxDecimal aZeroDec; + aZeroDec.setLong( 0 ); + bool bZero = ( EQ == compare( *this, aZeroDec ) ); + return bZero; +} + +SbxDecimal::CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight ) +{ + HRESULT hResult = VarDecCmp( (LPDECIMAL)&rLeft.maDec, (LPDECIMAL)&rRight.maDec ); + SbxDecimal::CmpResult eRes = (SbxDecimal::CmpResult)hResult; + return eRes; +} + +void SbxDecimal::setChar( sal_Unicode val ) +{ + VarDecFromUI2( (USHORT)val, &maDec ); +} + +void SbxDecimal::setByte( BYTE val ) +{ + VarDecFromUI1( (BYTE)val, &maDec ); +} + +void SbxDecimal::setShort( INT16 val ) +{ + VarDecFromI2( (short)val, &maDec ); +} + +void SbxDecimal::setLong( INT32 val ) +{ + VarDecFromI4( (long)val, &maDec ); +} + +void SbxDecimal::setUShort( UINT16 val ) +{ + VarDecFromUI2( (USHORT)val, &maDec ); +} + +void SbxDecimal::setULong( UINT32 val ) +{ + VarDecFromUI4( (ULONG)val, &maDec ); +} + +bool SbxDecimal::setSingle( float val ) +{ + bool bRet = ( VarDecFromR4( val, &maDec ) == S_OK ); + return bRet; +} + +bool SbxDecimal::setDouble( double val ) +{ + bool bRet = ( VarDecFromR8( val, &maDec ) == S_OK ); + return bRet; +} + +void SbxDecimal::setInt( int val ) +{ + setLong( (INT32)val ); +} + +void SbxDecimal::setUInt( unsigned int val ) +{ + setULong( (UINT32)val ); +} + +// sbxscan.cxx +void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ); + +bool SbxDecimal::setString( String* pString ) +{ + static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); + + // Convert delimiter + sal_Unicode cDecimalSep; + sal_Unicode cThousandSep; + ImpGetIntntlSep( cDecimalSep, cThousandSep ); + + bool bRet = false; + HRESULT hResult; + if( cDecimalSep != '.' || cThousandSep != ',' ) + { + int nLen = pString->Len(); + sal_Unicode* pBuffer = new sal_Unicode[nLen + 1]; + pBuffer[nLen] = 0; + + const sal_Unicode* pSrc = pString->GetBuffer(); + int i; + for( i = 0 ; i < nLen ; ++i ) + pBuffer[i] = pSrc[i]; + + sal_Unicode c; + i = 0; + while( (c = pBuffer[i]) != 0 ) + { + if( c == cDecimalSep ) + pBuffer[i] = '.'; + else if( c == cThousandSep ) + pBuffer[i] = ','; + i++; + } + hResult = VarDecFromStr( (OLECHAR*)pBuffer, nLANGID, 0, &maDec ); + delete pBuffer; + } + else + { + hResult = VarDecFromStr( (OLECHAR*)pString->GetBuffer(), nLANGID, 0, &maDec ); + } + bRet = ( hResult == S_OK ); + return bRet; +} + + +bool SbxDecimal::getChar( sal_Unicode& rVal ) +{ + bool bRet = ( VarUI2FromDec( &maDec, &rVal ) == S_OK ); + return bRet; +} + +bool SbxDecimal::getShort( INT16& rVal ) +{ + bool bRet = ( VarI2FromDec( &maDec, &rVal ) == S_OK ); + return bRet; +} + +bool SbxDecimal::getLong( INT32& rVal ) +{ + bool bRet = ( VarI4FromDec( &maDec, &rVal ) == S_OK ); + return bRet; +} + +bool SbxDecimal::getUShort( UINT16& rVal ) +{ + bool bRet = ( VarUI2FromDec( &maDec, &rVal ) == S_OK ); + return bRet; +} + +bool SbxDecimal::getULong( UINT32& rVal ) +{ + bool bRet = ( VarUI4FromDec( &maDec, &rVal ) == S_OK ); + return bRet; +} + +bool SbxDecimal::getSingle( float& rVal ) +{ + bool bRet = ( VarR4FromDec( &maDec, &rVal ) == S_OK ); + return bRet; +} + +bool SbxDecimal::getDouble( double& rVal ) +{ + bool bRet = ( VarR8FromDec( &maDec, &rVal ) == S_OK ); + return bRet; +} + +bool SbxDecimal::getUInt( unsigned int& rVal ) +{ + UINT32 TmpVal; + bool bRet = getULong( TmpVal ); + rVal = TmpVal; + return bRet; +} + +#else +// !WIN32 + +bool SbxDecimal::operator -= ( const SbxDecimal &r ) +{ + (void)r; + return false; +} + +bool SbxDecimal::operator += ( const SbxDecimal &r ) +{ + (void)r; + return false; +} + +bool SbxDecimal::operator /= ( const SbxDecimal &r ) +{ + (void)r; + return false; +} + +bool SbxDecimal::operator *= ( const SbxDecimal &r ) +{ + (void)r; + return false; +} + +bool SbxDecimal::neg( void ) +{ + return false; +} + +bool SbxDecimal::isZero( void ) +{ + return false; +} + +SbxDecimal::CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight ) +{ + (void)rLeft; + (void)rRight; + return (SbxDecimal::CmpResult)0; +} + +void SbxDecimal::setChar( sal_Unicode val ) { (void)val; } +void SbxDecimal::setByte( BYTE val ) { (void)val; } +void SbxDecimal::setLong( INT32 val ) { (void)val; } +void SbxDecimal::setULong( UINT32 val ) { (void)val; } +bool SbxDecimal::setSingle( float val ) { (void)val; return false; } +bool SbxDecimal::setDouble( double val ) { (void)val; return false; } +void SbxDecimal::setInt( int val ) { (void)val; } +void SbxDecimal::setUInt( unsigned int val ) { (void)val; } + +bool SbxDecimal::getSingle( float& rVal ) { (void)rVal; return false; } +bool SbxDecimal::getDouble( double& rVal ) { (void)rVal; return false; } + +#endif + +#ifdef WIN32 +bool SbxDecimal::getString( String& rString ) +{ + static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); + + bool bRet = false; + + OLECHAR sz[100]; + BSTR aBStr = SysAllocString( sz ); + if( aBStr != NULL ) + { + HRESULT hResult = VarBstrFromDec( &maDec, nLANGID, 0, &aBStr ); + bRet = ( hResult == S_OK ); + if( bRet ) + { + // Convert delimiter + sal_Unicode cDecimalSep; + sal_Unicode cThousandSep; + ImpGetIntntlSep( cDecimalSep, cThousandSep ); + + if( cDecimalSep != '.' || cThousandSep != ',' ) + { + sal_Unicode c; + int i = 0; + while( (c = aBStr[i]) != 0 ) + { + if( c == '.' ) + aBStr[i] = cDecimalSep; + else if( c == ',' ) + aBStr[i] = cThousandSep; + i++; + } + } + rString = reinterpret_cast(aBStr); + } + + SysFreeString( aBStr ); + } + return bRet; +} +#endif + +SbxDecimal* ImpCreateDecimal( SbxValues* p ) +{ +#ifdef WIN32 + if( !p ) + return NULL; + + SbxDecimal*& rpDecimal = p->pDecimal; + if( rpDecimal == NULL ) + { + rpDecimal = new SbxDecimal(); + rpDecimal->addRef(); + } + return rpDecimal; +#else + (void)p; + return NULL; +#endif +} + +SbxDecimal* ImpGetDecimal( const SbxValues* p ) +{ +#ifdef WIN32 + SbxValues aTmp; + SbxDecimal* pnDecRes; + + SbxDataType eType = p->eType; + if( eType == SbxDECIMAL && p->pDecimal ) + { + pnDecRes = new SbxDecimal( *p->pDecimal ); + pnDecRes->addRef(); + return pnDecRes; + } + pnDecRes = new SbxDecimal(); + pnDecRes->addRef(); + +start: + switch( +eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + pnDecRes->setShort( 0 ); break; + case SbxCHAR: + pnDecRes->setChar( p->nChar ); break; + case SbxBYTE: + pnDecRes->setByte( p->nByte ); break; + case SbxINTEGER: + case SbxBOOL: + pnDecRes->setInt( p->nInteger ); break; + case SbxERROR: + case SbxUSHORT: + pnDecRes->setUShort( p->nUShort ); break; + case SbxLONG: + pnDecRes->setLong( p->nLong ); break; + case SbxULONG: + pnDecRes->setULong( p->nULong ); break; + case SbxSINGLE: + if( !pnDecRes->setSingle( p->nSingle ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + break; + case SbxSALINT64: + { + double d = (double)p->nInt64; + pnDecRes->setDouble( d ); + break; + } + case SbxSALUINT64: + { + double d = ImpSalUInt64ToDouble( p->uInt64 ); + pnDecRes->setDouble( d ); + break; + } + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else + dVal = p->nDouble; + + if( !pnDecRes->setDouble( dVal ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + break; + } + case SbxLPSTR: + case SbxSTRING: + case SbxBYREF | SbxSTRING: + pnDecRes->setString( p->pString ); break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pnDecRes->setDecimal( pVal->GetDecimal() ); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); + pnDecRes->setShort( 0 ); + } + break; + } + + case SbxBYREF | SbxCHAR: + pnDecRes->setChar( *p->pChar ); break; + case SbxBYREF | SbxBYTE: + pnDecRes->setByte( *p->pByte ); break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + pnDecRes->setInt( *p->pInteger ); break; + case SbxBYREF | SbxLONG: + pnDecRes->setLong( *p->pLong ); break; + case SbxBYREF | SbxULONG: + pnDecRes->setULong( *p->pULong ); break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + pnDecRes->setUShort( *p->pUShort ); break; + + // ab hier muss getestet werden + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); pnDecRes->setShort( 0 ); + } + return pnDecRes; +#else + (void)p; + return NULL; +#endif +} + + +void ImpPutDecimal( SbxValues* p, SbxDecimal* pDec ) +{ +#ifdef WIN32 + if( !pDec ) + return; + + SbxValues aTmp; +start: + switch( +p->eType ) + { + // hier muss getestet werden + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxSALUINT64: + aTmp.puInt64 = &p->uInt64; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxLONG: + aTmp.pLong = &p->nLong; goto direct; + case SbxSALINT64: + aTmp.pnInt64 = &p->nInt64; goto direct; + case SbxCURRENCY: + aTmp.pLong64 = &p->nLong64; goto direct; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // ab hier nicht mehr + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + if( pDec != p->pDecimal ) + { + releaseDecimalPtr( p->pDecimal ); + p->pDecimal = pDec; + if( pDec ) + pDec->addRef(); + } + break; + } + case SbxSINGLE: + { + float f; + pDec->getSingle( f ); + p->nSingle = f; + break; + } + case SbxDATE: + case SbxDOUBLE: + { + double d; + pDec->getDouble( d ); + p->nDouble = d; + break; + } + case SbxULONG64: + { + double d; + pDec->getDouble( d ); + p->nULong64 = ImpDoubleToUINT64( d ); + break; + } + case SbxLONG64: + { + double d; + pDec->getDouble( d ); + p->nLong64 = ImpDoubleToINT64( d ); + break; + } + + case SbxLPSTR: + case SbxSTRING: + case SbxBYREF | SbxSTRING: + if( !p->pString ) + p->pString = new XubString; + pDec->getString( *p->pString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutDecimal( pDec ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + + case SbxBYREF | SbxCHAR: + if( !pDec->getChar( *p->pChar ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pChar = 0; + } + break; + case SbxBYREF | SbxBYTE: + if( !pDec->getChar( *p->pChar ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pByte = 0; + } + break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( !pDec->getShort( *p->pInteger ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pInteger = 0; + } + break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( !pDec->getUShort( *p->pUShort ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pUShort = 0; + } + break; + case SbxBYREF | SbxLONG: + if( !pDec->getLong( *p->pLong ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pLong = 0; + } + break; + case SbxBYREF | SbxULONG: + if( !pDec->getULong( *p->pULong ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pULong = 0; + } + break; + case SbxBYREF | SbxSALINT64: + { + double d; + if( !pDec->getDouble( d ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + else + *p->pnInt64 = ImpDoubleToSalInt64( d ); + break; + } + case SbxBYREF | SbxSALUINT64: + { + double d; + if( !pDec->getDouble( d ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + else + *p->puInt64 = ImpDoubleToSalUInt64( d ); + break; + } + case SbxBYREF | SbxSINGLE: + if( !pDec->getSingle( *p->pSingle ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pSingle = 0; + } + break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + if( !pDec->getDouble( *p->pDouble ) ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + *p->pDouble = 0; + } + break; + case SbxBYREF | SbxULONG64: + { + double d; + pDec->getDouble( d ); + *p->pULong64 = ImpDoubleToUINT64( d ); + break; + } + case SbxBYREF | SbxLONG64: + { + double d; + pDec->getDouble( d ); + *p->pLong64 = ImpDoubleToINT64( d ); + break; + } + case SbxBYREF | SbxCURRENCY: + { + double d; + pDec->getDouble( d ); + *p->pLong64 = ImpDoubleToCurrency( d ); + break; + } + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +#else + (void)p; + (void)pDec; +#endif +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxdec.hxx b/bf_basic/source/sbx/sbxdec.hxx new file mode 100644 index 00000000000..6c4da40b453 --- /dev/null +++ b/bf_basic/source/sbx/sbxdec.hxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef __SBX_SBX_DEC_HXX +#define __SBX_SBX_DEC_HXX + +#ifdef WIN32 + +#include +} // close extern "C" { + +#ifndef __MINGW32__ +#include +#endif +#include + +extern "C" { // reopen extern "C" { +#include + +#endif +#endif + +#include "sbx.hxx" + +#include + +namespace binfilter { + +// Decimal support +// Implementation only for windows + +class SbxDecimal +{ + friend void releaseDecimalPtr( SbxDecimal*& rpDecimal ); + +#ifdef WIN32 + DECIMAL maDec; +#endif + INT32 mnRefCount; + +public: +#ifdef WIN32 + SbxDecimal(); +#endif + SbxDecimal( const SbxDecimal& rDec ); + + ~SbxDecimal(); + + void addRef( void ) + { mnRefCount++; } + + void setChar( sal_Unicode val ); + void setByte( BYTE val ); +#ifdef WIN32 + void setShort( INT16 val ); + bool setString( String* pString ); + void setUShort( UINT16 val ); +#endif + void setLong( INT32 val ); + void setULong( UINT32 val ); + bool setSingle( float val ); + bool setDouble( double val ); + void setInt( int val ); + void setUInt( unsigned int val ); + void setDecimal( SbxDecimal* pDecimal ) + { +#ifdef WIN32 + if( pDecimal ) + maDec = pDecimal->maDec; +#else + (void)pDecimal; +#endif + } + +#ifdef WIN32 + bool getShort( INT16& rVal ); + bool getChar( sal_Unicode& rVal ); + bool getLong( INT32& rVal ); + bool getString( String& rString ); + bool getUInt( unsigned int& rVal ); + bool getULong( UINT32& rVal ); + bool getUShort( UINT16& rVal ); +#endif + bool getSingle( float& rVal ); + bool getDouble( double& rVal ); + + bool operator -= ( const SbxDecimal &r ); + bool operator += ( const SbxDecimal &r ); + bool operator /= ( const SbxDecimal &r ); + bool operator *= ( const SbxDecimal &r ); + bool neg( void ); + + bool isZero( void ); + + enum CmpResult { LT, EQ, GT }; + friend CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight ); +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxexec.cxx b/bf_basic/source/sbx/sbxexec.cxx new file mode 100644 index 00000000000..74946d44db1 --- /dev/null +++ b/bf_basic/source/sbx/sbxexec.cxx @@ -0,0 +1,335 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include "sbx.hxx" + +namespace binfilter { + +class SbxSimpleCharClass +{ +public: + BOOL isAlpha( sal_Unicode c ) const + { + BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); + return bRet; + } + + BOOL isDigit( sal_Unicode c ) const + { + BOOL bRet = (c >= '0' && c <= '9'); + return bRet; + } + + BOOL isAlphaNumeric( sal_Unicode c ) const + { + BOOL bRet = isDigit( c ) || isAlpha( c ); + return bRet; + } +}; + + +static SbxVariable* Element + ( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, + SbxClassType, const SbxSimpleCharClass& rCharClass ); + +static const xub_Unicode* SkipWhitespace( const xub_Unicode* p ) +{ + while( *p && ( *p == ' ' || *p == '\t' ) ) + p++; + return p; +} + +// Scannen eines Symbol. Das Symbol wird in rSym eingetragen, der Returnwert +// ist die neue Scanposition. Bei Fehlern ist das Symbol leer. + +static const xub_Unicode* Symbol( const xub_Unicode* p, XubString& rSym, const SbxSimpleCharClass& rCharClass ) +{ + USHORT nLen = 0; + // Haben wir ein Sondersymbol? + if( *p == '[' ) + { + rSym = ++p; + while( *p && *p != ']' ) + p++, nLen++; + p++; + } + else + { + // Ein Symbol muss mit einem Buchstaben oder einem Underline beginnen + if( !rCharClass.isAlpha( *p ) && *p != '_' ) + SbxBase::SetError( SbxERR_SYNTAX ); + else + { + rSym = p; + // Dann darf es Buchstaben, Zahlen oder Underlines enthalten + while( *p && (rCharClass.isAlphaNumeric( *p ) || *p == '_') ) + p++, nLen++; + // BASIC-Standard-Suffixe werden ignoriert + if( *p && (*p == '%' || *p == '&' || *p == '!' || *p == '#' || *p == '$' ) ) + p++; + } + } + rSym.Erase( nLen ); + return p; +} + +// Qualifizierter Name. Element.Element.... + +static SbxVariable* QualifiedName + ( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, SbxClassType t ) +{ + static SbxSimpleCharClass aCharClass; + + SbxVariableRef refVar; + const xub_Unicode* p = SkipWhitespace( *ppBuf ); + if( aCharClass.isAlpha( *p ) || *p == '_' || *p == '[' ) + { + // Element einlesen + refVar = Element( pObj, pGbl, &p, t, aCharClass ); + while( refVar.Is() && (*p == '.' || *p == '!') ) + { + // Es folgt noch ein Objektelement. Das aktuelle Element + // muss also ein SBX-Objekt sein oder liefern! + pObj = PTR_CAST(SbxObject,(SbxVariable*) refVar); + if( !pObj ) + // Dann muss es ein Objekt liefern + pObj = PTR_CAST(SbxObject,refVar->GetObject()); + refVar.Clear(); + if( !pObj ) + break; + p++; + // Und das naechste Element bitte + refVar = Element( pObj, pGbl, &p, t, aCharClass ); + } + } + else + SbxBase::SetError( SbxERR_SYNTAX ); + *ppBuf = p; + if( refVar.Is() ) + refVar->AddRef(); + return refVar; +} + +// Einlesen eines Operanden. Dies kann eine Zahl, ein String oder +// eine Funktion (mit optionalen Parametern) sein. + +static SbxVariable* Operand + ( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, BOOL bVar ) +{ + static SbxSimpleCharClass aCharClass; + + SbxVariableRef refVar( new SbxVariable ); + const xub_Unicode* p = SkipWhitespace( *ppBuf ); + if( !bVar && ( aCharClass.isDigit( *p ) + || ( *p == '.' && aCharClass.isDigit( *( p+1 ) ) ) + || *p == '-' + || *p == '&' ) ) + { + // Eine Zahl kann direkt eingescant werden! + USHORT nLen; + if( !refVar->Scan( XubString( p ), &nLen ) ) + refVar.Clear(); + else + p += nLen; + } + else if( !bVar && *p == '"' ) + { + // Ein String + XubString aString; + p++; + for( ;; ) + { + // Das ist wohl ein Fehler + if( !*p ) + return NULL; + // Doppelte Quotes sind OK + if( *p == '"' ) + if( *++p != '"' ) + break; + aString += *p++; + } + refVar->PutString( aString ); + } + else + refVar = QualifiedName( pObj, pGbl, &p, SbxCLASS_DONTCARE ); + *ppBuf = p; + if( refVar.Is() ) + refVar->AddRef(); + return refVar; +} + +// Einlesen einer einfachen Term. Die Operatoren +, -, * und / +// werden unterstuetzt. + +static SbxVariable* MulDiv( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf ) +{ + const xub_Unicode* p = *ppBuf; + SbxVariableRef refVar( Operand( pObj, pGbl, &p, FALSE ) ); + p = SkipWhitespace( p ); + while( refVar.Is() && ( *p == '*' || *p == '/' ) ) + { + xub_Unicode cOp = *p++; + SbxVariableRef refVar2( Operand( pObj, pGbl, &p, FALSE ) ); + if( refVar2.Is() ) + { + // temporaere Variable! + SbxVariable* pVar = refVar; + pVar = new SbxVariable( *pVar ); + refVar = pVar; + if( cOp == '*' ) + *refVar *= *refVar2; + else + *refVar /= *refVar2; + } + else + { + refVar.Clear(); + break; + } + } + *ppBuf = p; + if( refVar.Is() ) + refVar->AddRef(); + return refVar; +} + +static SbxVariable* PlusMinus( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf ) +{ + const xub_Unicode* p = *ppBuf; + SbxVariableRef refVar( MulDiv( pObj, pGbl, &p ) ); + p = SkipWhitespace( p ); + while( refVar.Is() && ( *p == '+' || *p == '-' ) ) + { + xub_Unicode cOp = *p++; + SbxVariableRef refVar2( MulDiv( pObj, pGbl, &p ) ); + if( refVar2.Is() ) + { + // temporaere Variable! + SbxVariable* pVar = refVar; + pVar = new SbxVariable( *pVar ); + refVar = pVar; + if( cOp == '+' ) + *refVar += *refVar2; + else + *refVar -= *refVar2; + } + else + { + refVar.Clear(); + break; + } + } + *ppBuf = p; + if( refVar.Is() ) + refVar->AddRef(); + return refVar; +} + + +static SbxVariable* Element + ( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, + SbxClassType t, const SbxSimpleCharClass& rCharClass ) +{ + XubString aSym; + const xub_Unicode* p = Symbol( *ppBuf, aSym, rCharClass ); + SbxVariableRef refVar; + if( aSym.Len() ) + { + USHORT nOld = pObj->GetFlags(); + if( pObj == pGbl ) + pObj->SetFlag( SBX_GBLSEARCH ); + refVar = pObj->Find( aSym, t ); + pObj->SetFlags( nOld ); + if( refVar.Is() ) + { + refVar->SetParameters( NULL ); + // folgen noch Parameter? + p = SkipWhitespace( p ); + if( *p == '(' ) + { + p++; + SbxArrayRef refPar = new SbxArray; + USHORT nArg = 0; + // Wird sind mal relaxed und akzeptieren auch + // das Zeilen- oder Komandoende als Begrenzer + // Parameter immer global suchen! + while( *p && *p != ')' && *p != ']' ) + { + SbxVariableRef refArg = PlusMinus( pGbl, pGbl, &p ); + if( !refArg ) + { + // Fehler beim Parsing + refVar.Clear(); break; + } + else + { + // Man kopiere den Parameter, damit + // man den aktuellen Zustand hat (loest auch + // den Aufruf per Zugriff aus) + SbxVariable* pArg = refArg; + refPar->Put( new SbxVariable( *pArg ), ++nArg ); + } + p = SkipWhitespace( p ); + if( *p == ',' ) + p++; + } + if( *p == ')' ) + p++; + if( refVar.Is() ) + refVar->SetParameters( refPar ); + } + } + else + SbxBase::SetError( SbxERR_NO_METHOD ); + } + *ppBuf = p; + if( refVar.Is() ) + refVar->AddRef(); + return refVar; +} + + +SbxVariable* SbxObject::FindQualified( const XubString& rName, SbxClassType t ) +{ + SbxVariable* pVar = NULL; + const xub_Unicode* p = rName.GetBuffer(); + p = SkipWhitespace( p ); + if( !*p ) + return NULL;; + pVar = QualifiedName( this, this, &p, t ); + p = SkipWhitespace( p ); + if( *p ) + SetError( SbxERR_SYNTAX ); + return pVar; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxint.cxx b/bf_basic/source/sbx/sbxint.cxx new file mode 100644 index 00000000000..640c68a2eec --- /dev/null +++ b/bf_basic/source/sbx/sbxint.cxx @@ -0,0 +1,970 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +double ImpRound( double d ) +{ + return d + ( d < 0 ? -0.5 : 0.5 ); +} + +INT16 ImpGetInteger( const SbxValues* p ) +{ + SbxValues aTmp; + INT16 nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger; break; + case SbxERROR: + case SbxUSHORT: + if( p->nUShort > (USHORT) SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else + nRes = (INT16) p->nUShort; + break; + case SbxLONG: + if( p->nLong > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else if( p->nLong < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; + } + else + nRes = (INT16) p->nLong; + break; + case SbxULONG: + if( p->nULong > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else + nRes = (INT16) p->nULong; + break; + case SbxSINGLE: + if( p->nSingle > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else if( p->nSingle < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; + } + else + nRes = (INT16) ImpRound( p->nSingle ); + break; + case SbxSALINT64: + if( p->nInt64 > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else if( p->nInt64 < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; + } + else + nRes = (INT16) p->nInt64; + break; + case SbxSALUINT64: + if( p->uInt64 > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else + nRes = (INT16) p->uInt64; + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else if( p->eType == SbxDECIMAL ) + { + dVal = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( dVal ); + } + else + dVal = p->nDouble; + + if( dVal > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else if( dVal < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; + } + else + nRes = (INT16) ImpRound( dVal ); + break; + } + case SbxLPSTR: + case SbxSTRING: + case SbxBYREF | SbxSTRING: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; + } + else if( d < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; + } + else + nRes = (INT16) ImpRound( d ); + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetInteger(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger; break; + + // ab hier muss getestet werden + case SbxBYREF | SbxLONG: + aTmp.nLong = *p->pLong; goto ref; + case SbxBYREF | SbxULONG: + aTmp.nULong = *p->pULong; goto ref; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + aTmp.nUShort = *p->pUShort; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutInteger( SbxValues* p, INT16 n ) +{ + SbxValues aTmp; +start: + switch( +p->eType ) + { + // hier muss getestet werden + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxSALUINT64: + aTmp.puInt64 = &p->uInt64; goto direct; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // ab hier nicht mehr + case SbxINTEGER: + case SbxBOOL: + p->nInteger = n; break; + case SbxLONG: + p->nLong = n; break; + case SbxSINGLE: + p->nSingle = n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + case SbxSALINT64: + p->nInt64 = n; break; + case SbxULONG64: + p->nULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxLONG64: + p->nLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxCURRENCY: + p->nLong64 = ImpDoubleToCurrency( (double)n ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + ImpCreateDecimal( p )->setInt( n ); + break; + + case SbxLPSTR: + case SbxSTRING: + case SbxBYREF | SbxSTRING: + if( !p->pString ) + p->pString = new XubString; + ImpCvtNum( (double) n, 0, *p->pString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutInteger( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR; + } + *p->pChar = (char) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + *p->pInteger = n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + *p->pLong = (INT32) n; break; + case SbxBYREF | SbxULONG: + if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); *p->puInt64 = 0; + } + else + *p->puInt64 = n; + break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = (float) n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) n; break; + case SbxBYREF | SbxULONG64: + *p->pULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxBYREF | SbxLONG64: + *p->pLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxBYREF | SbxCURRENCY: + *p->pLong64 = ImpDoubleToCurrency( (double)n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + + +// sal_Int64 / hyper + +sal_Int64 ImpDoubleToSalInt64( double d ) +{ + sal_Int64 nRes; + if( d > SbxMAXSALINT64 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXSALINT64; + } + else if( d < SbxMINSALINT64 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINSALINT64; + } + else + nRes = (sal_Int64) ImpRound( d ); + return nRes; +} + +sal_uInt64 ImpDoubleToSalUInt64( double d ) +{ + sal_uInt64 nRes; + if( d > SbxMAXSALUINT64 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXSALUINT64; + } + else if( d < 0.0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (sal_uInt64) ImpRound( d ); + return nRes; +} + +double ImpSalUInt64ToDouble( sal_uInt64 n ) +{ + double d = 0.0; + if( n > SbxMAXSALINT64 ) + SbxBase::SetError( SbxERR_CONVERSION ); + else + d = (double)(sal_Int64) n; + return d; +} + + +sal_Int64 ImpGetInt64( const SbxValues* p ) +{ + SbxValues aTmp; + sal_Int64 nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger; break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; break; + case SbxLONG: + nRes = p->nLong; break; + case SbxULONG: + nRes = (sal_Int64) p->nULong; break; + case SbxSINGLE: + nRes = ImpDoubleToSalInt64( (double)p->nSingle ); + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else + dVal = p->nDouble; + + nRes = ImpDoubleToSalInt64( dVal ); + break; + } + case SbxSALINT64: + nRes = p->nInt64; break; + case SbxSALUINT64: + if( p->uInt64 > SbxMAXSALINT64 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXSALINT64; + } + else + nRes = (sal_Int64) p->uInt64; + break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + ::rtl::OUString aOUStr( *p->pString ); + ::rtl::OString aOStr = ::rtl::OUStringToOString + ( aOUStr, RTL_TEXTENCODING_ASCII_US ); + nRes = aOStr.toInt64(); + if( nRes == 0 ) + { + // Check if really 0 or invalid conversion + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else + nRes = ImpDoubleToSalInt64( d ); + } + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetInt64(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger; break; + case SbxBYREF | SbxLONG: + nRes = *p->pLong; break; + case SbxBYREF | SbxULONG: + nRes = *p->pULong; break; + case SbxBYREF | SbxSALINT64: + nRes = *p->pnInt64; break; + + // from here the values has to be checked + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + aTmp.nUShort = *p->pUShort; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutInt64( SbxValues* p, sal_Int64 n ) +{ + SbxValues aTmp; + +start: + switch( +p->eType ) + { + // Check neccessary + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxULONG64: + aTmp.pULong64 = &p->nULong64; goto direct; + case SbxLONG64: + case SbxCURRENCY: + aTmp.pLong64 = &p->nLong64; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxLONG: + aTmp.pnInt64 = &p->nInt64; goto direct; + case SbxSALUINT64: + aTmp.puInt64 = &p->uInt64; goto direct; + + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // Check not neccessary + case SbxSALINT64: + p->nInt64 = n; break; + case SbxSINGLE: + p->nSingle = (float) n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = (double) n; break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + { + if( !p->pString ) + p->pString = new XubString; + + ::rtl::OString aOStr = ::rtl::OString::valueOf( n ); + ::rtl::OUString aOUStr = ::rtl::OStringToOUString + ( aOStr, RTL_TEXTENCODING_ASCII_US ); + (*p->pString) = aOUStr; + break; + } + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutInt64( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR; + } + else if( n < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR; + } + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + else if( n < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + if( n > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG; + } + else if( n < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG; + } + *p->pLong = (INT32) n; break; + case SbxBYREF | SbxULONG: + if( n > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXULNG; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = (float) n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) n; break; + case SbxBYREF | SbxCURRENCY: + if( n > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = (sal_Int64) SbxMAXCURR; + } + else if( n < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = (sal_Int64) SbxMINCURR; + } + *p->pLong64 = ImpDoubleToCurrency( (double)n ); break; + + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->puInt64 = (sal_Int64) n; break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +sal_uInt64 ImpGetUInt64( const SbxValues* p ) +{ + SbxValues aTmp; + sal_uInt64 nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger; break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; break; + case SbxLONG: + nRes = p->nLong; break; + case SbxULONG: + nRes = (sal_uInt64) p->nULong; break; + case SbxSINGLE: + nRes = ImpDoubleToSalUInt64( (double)p->nSingle ); + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else + dVal = p->nDouble; + + nRes = ImpDoubleToSalUInt64( dVal ); + break; + } + case SbxSALINT64: + if( p->nInt64 < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (sal_uInt64) p->nInt64; + case SbxSALUINT64: + nRes = p->uInt64; break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + ::rtl::OUString aOUStr( *p->pString ); + ::rtl::OString aOStr = ::rtl::OUStringToOString + ( aOUStr, RTL_TEXTENCODING_ASCII_US ); + sal_Int64 n64 = aOStr.toInt64(); + if( n64 == 0 ) + { + // Check if really 0 or invalid conversion + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXSALUINT64 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXSALUINT64; + } + else if( d < 0.0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (sal_uInt64) ImpRound( d ); + } + else if( n64 < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + { + nRes = n64; + } + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetUInt64(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger; break; + case SbxBYREF | SbxLONG: + nRes = *p->pLong; break; + case SbxBYREF | SbxULONG: + nRes = *p->pULong; break; + case SbxBYREF | SbxSALUINT64: + nRes = *p->puInt64; break; + + // from here the values has to be checked + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + aTmp.nUShort = *p->pUShort; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutUInt64( SbxValues* p, sal_uInt64 n ) +{ + SbxValues aTmp; + +start: + switch( +p->eType ) + { + // Check neccessary + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxULONG64: + aTmp.pULong64 = &p->nULong64; goto direct; + case SbxLONG64: + case SbxCURRENCY: + aTmp.pLong64 = &p->nLong64; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxLONG: + aTmp.pnInt64 = &p->nInt64; goto direct; + case SbxSALINT64: + aTmp.pnInt64 = &p->nInt64; goto direct; + case SbxSINGLE: + aTmp.pSingle = &p->nSingle; goto direct; + case SbxDATE: + case SbxDOUBLE: + aTmp.pDouble = &p->nDouble; goto direct; + + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // Check not neccessary + case SbxSALUINT64: + p->uInt64 = n; break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + if( n > SbxMAXSALINT64 ) + SbxBase::SetError( SbxERR_CONVERSION ); + else + { + ::rtl::OString aOStr = ::rtl::OString::valueOf( (sal_Int64)n ); + ::rtl::OUString aOUStr = ::rtl::OStringToOUString + ( aOStr, RTL_TEXTENCODING_ASCII_US ); + (*p->pString) = aOUStr; + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutUInt64( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR; + } + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + if( n > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG; + } + *p->pLong = (INT32) n; break; + case SbxBYREF | SbxULONG: + if( n > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXULNG; + } + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSINGLE: + *p->pDouble = (float)ImpSalUInt64ToDouble( n ); break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = ImpSalUInt64ToDouble( n ); break; + case SbxBYREF | SbxCURRENCY: + if( n > SbxMAXSALINT64 || (sal_Int64)n > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = (sal_Int64) SbxMAXCURR; + } + *p->pLong64 = ImpDoubleToCurrency( (double)(sal_Int64) n ); break; + + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = n; break; + case SbxBYREF | SbxSALINT64: + if( n > SbxMAXSALINT64 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pnInt64 = (sal_Int64) n; break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxlng.cxx b/bf_basic/source/sbx/sbxlng.cxx new file mode 100644 index 00000000000..6050c70ae4c --- /dev/null +++ b/bf_basic/source/sbx/sbxlng.cxx @@ -0,0 +1,345 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +INT32 ImpGetLong( const SbxValues* p ) +{ + SbxValues aTmp; + INT32 nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger; break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; break; + case SbxLONG: + nRes = p->nLong; break; + case SbxULONG: + if( p->nULong > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXLNG; + } + else + nRes = (INT32) p->nULong; + break; + case SbxSINGLE: + if( p->nSingle > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXLNG; + } + else if( p->nSingle < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINLNG; + } + else + nRes = (INT32) ImpRound( p->nSingle ); + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxSALINT64: + case SbxSALUINT64: + case SbxCURRENCY: + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else if( p->eType == SbxSALINT64 ) + dVal = static_cast< double >(p->nInt64); + else if( p->eType == SbxSALUINT64 ) + dVal = ImpSalUInt64ToDouble( p->uInt64 ); + else if( p->eType == SbxDECIMAL ) + { + dVal = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( dVal ); + } + else + dVal = p->nDouble; + + if( dVal > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXLNG; + } + else if( dVal < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINLNG; + } + else + nRes = (INT32) ImpRound( dVal ); + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXLNG; + } + else if( d < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINLNG; + } + else + nRes = (INT32) ImpRound( d ); + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetLong(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger; break; + case SbxBYREF | SbxLONG: + nRes = *p->pLong; break; + + // ab hier muss getestet werden + case SbxBYREF | SbxULONG: + aTmp.nULong = *p->pULong; goto ref; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + aTmp.nUShort = *p->pUShort; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutLong( SbxValues* p, INT32 n ) +{ + SbxValues aTmp; + +start: + switch( +p->eType ) + { + // Ab hier muss getestet werden + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxULONG64: + aTmp.pULong64 = &p->nULong64; goto direct; + case SbxLONG64: + case SbxCURRENCY: + aTmp.pLong64 = &p->nLong64; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxSALUINT64: + aTmp.puInt64 = &p->uInt64; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // ab hier nicht mehr + case SbxLONG: + p->nLong = n; break; + case SbxSINGLE: + p->nSingle = (float) n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + case SbxSALINT64: + p->nInt64 = n; break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + ImpCreateDecimal( p )->setLong( n ); + break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + ImpCvtNum( (double) n, 0, *p->pString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutLong( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR; + } + else if( n < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR; + } + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + else if( n < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + *p->pLong = n; break; + case SbxBYREF | SbxULONG: + if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pULong = (UINT32) n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); *p->puInt64 = 0; + } + else + *p->puInt64 = n; + break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = (float) n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) n; break; + case SbxBYREF | SbxCURRENCY: + double d; + if( n > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); d = SbxMAXCURR; + } + else if( n < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); d = SbxMINCURR; + } + else + { + d = n; + } + *p->pLong64 = ImpDoubleToCurrency( d ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxobj.cxx b/bf_basic/source/sbx/sbxobj.cxx new file mode 100644 index 00000000000..fad14c39546 --- /dev/null +++ b/bf_basic/source/sbx/sbxobj.cxx @@ -0,0 +1,854 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include "sbx.hxx" +#include "sbxres.hxx" + +#include + +namespace binfilter { + +TYPEINIT1(SbxMethod,SbxVariable) +TYPEINIT1(SbxProperty,SbxVariable) +TYPEINIT2(SbxObject,SbxVariable,SfxListener) + +static const char* pNameProp; // Name-Property +static const char* pParentProp; // Parent-Property + +static USHORT nNameHash = 0, nParentHash = 0; + +///////////////////////////////////////////////////////////////////////// + +SbxObject::SbxObject( const XubString& rClass ) + : SbxVariable( SbxOBJECT ), aClassName( rClass ) +{ + aData.pObj = this; + if( !nNameHash ) + { + pNameProp = GetSbxRes( STRING_NAMEPROP ); + pParentProp = GetSbxRes( STRING_PARENTPROP ); + nNameHash = MakeHashCode( String::CreateFromAscii( pNameProp ) ); + nParentHash = MakeHashCode( String::CreateFromAscii( pParentProp ) ); + } + SbxObject::Clear(); + SbxObject::SetName( rClass ); +} + +SbxObject::SbxObject( const SbxObject& rObj ) + : SvRefBase( rObj ), SbxVariable( rObj.GetType() ), + SfxListener( rObj ) +{ + *this = rObj; +} + +SbxObject& SbxObject::operator=( const SbxObject& r ) +{ + if( &r != this ) + { + SbxVariable::operator=( r ); + aClassName = r.aClassName; + pMethods = new SbxArray; + pProps = new SbxArray; + pObjs = new SbxArray( SbxOBJECT ); + // Die Arrays werden kopiert, die Inhalte uebernommen + *pMethods = *r.pMethods; + *pProps = *r.pProps; + *pObjs = *r.pObjs; + // Da die Variablen uebernommen wurden, ist dies OK + pDfltProp = r.pDfltProp; + SetName( r.GetName() ); + SetFlags( r.GetFlags() ); + SetModified( TRUE ); + } + return *this; +} + +static void CheckParentsOnDelete( SbxObject* pObj, SbxArray* p ) +{ + for( USHORT i = 0; i < p->Count(); i++ ) + { + SbxVariableRef& rRef = p->GetRef( i ); + if( rRef->IsBroadcaster() ) + pObj->EndListening( rRef->GetBroadcaster(), TRUE ); + // Hat das Element mehr als eine Referenz und noch einen Listener? + if( rRef->GetRefCount() > 1 ) + { + rRef->SetParent( NULL ); + DBG_ASSERT( !rRef->IsBroadcaster() || rRef->GetBroadcaster().GetListenerCount(), "Object element with dangling parent" ); + } + } +} + +SbxObject::~SbxObject() +{ + CheckParentsOnDelete( this, pProps ); + CheckParentsOnDelete( this, pMethods ); + CheckParentsOnDelete( this, pObjs ); +} + +SbxDataType SbxObject::GetType() const +{ + return SbxOBJECT; +} + +SbxClassType SbxObject::GetClass() const +{ + return SbxCLASS_OBJECT; +} + +void SbxObject::Clear() +{ + pMethods = new SbxArray; + pProps = new SbxArray; + pObjs = new SbxArray( SbxOBJECT ); + SbxVariable* p; + p = Make( String::CreateFromAscii( pNameProp ), SbxCLASS_PROPERTY, SbxSTRING ); + p->SetFlag( SBX_DONTSTORE ); + p = Make( String::CreateFromAscii( pParentProp ), SbxCLASS_PROPERTY, SbxOBJECT ); + p->ResetFlag( SBX_WRITE ); + p->SetFlag( SBX_DONTSTORE ); + pDfltProp = NULL; + SetModified( FALSE ); +} + +void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, + const SfxHint& rHint, const TypeId& ) +{ + const SbxHint* p = PTR_CAST(SbxHint,&rHint); + if( p ) + { + ULONG nId = p->GetId(); + BOOL bRead = BOOL( nId == SBX_HINT_DATAWANTED ); + BOOL bWrite = BOOL( nId == SBX_HINT_DATACHANGED ); + SbxVariable* pVar = p->GetVar(); + if( bRead || bWrite ) + { + XubString aVarName( pVar->GetName() ); + USHORT nHash_ = MakeHashCode( aVarName ); + if( nHash_ == nNameHash + && aVarName.EqualsIgnoreCaseAscii( pNameProp ) ) + { + if( bRead ) + pVar->PutString( GetName() ); + else + SetName( pVar->GetString() ); + } + else if( nHash_ == nParentHash + && aVarName.EqualsIgnoreCaseAscii( pParentProp ) ) + { + SbxObject* p_ = GetParent(); + if( !p_ ) + p_ = this; + pVar->PutObject( p_ ); + } + } + } +} + +BOOL SbxObject::IsClass( const XubString& rName ) const +{ + return BOOL( aClassName.EqualsIgnoreCaseAscii( rName ) ); +} + +SbxVariable* SbxObject::FindUserData( UINT32 nData ) +{ + if( !GetAll( SbxCLASS_DONTCARE ) ) + return NULL; + + SbxVariable* pRes = pMethods->FindUserData( nData ); + if( !pRes ) + pRes = pProps->FindUserData( nData ); + if( !pRes ) + pRes = pObjs->FindUserData( nData ); + // Search in den Parents? + if( !pRes && IsSet( SBX_GBLSEARCH ) ) + { + SbxObject* pCur = this; + while( !pRes && pCur->pParent ) + { + // Ich selbst bin schon durchsucht worden! + USHORT nOwn = pCur->GetFlags(); + pCur->ResetFlag( SBX_EXTSEARCH ); + // Ich suche bereits global! + USHORT nPar = pCur->pParent->GetFlags(); + pCur->pParent->ResetFlag( SBX_GBLSEARCH ); + pRes = pCur->pParent->FindUserData( nData ); + pCur->SetFlags( nOwn ); + pCur->pParent->SetFlags( nPar ); + pCur = pCur->pParent; + } + } + return pRes; +} + +SbxVariable* SbxObject::Find( const XubString& rName, SbxClassType t ) +{ +#ifdef DBG_UTIL + static USHORT nLvl = 0; + static const char* pCls[] = + { "DontCare","Array","Value","Variable","Method","Property","Object" }; + rtl::OString aNameStr1(rtl::OUStringToOString(rName, RTL_TEXTENCODING_ASCII_US)); + rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); + DbgOutf( "SBX: Search %.*s %s %s in %s", + nLvl++, " ", + ( t >= SbxCLASS_DONTCARE && t <= SbxCLASS_OBJECT ) + ? pCls[ t-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr1.getStr() ); +#endif + + if( !GetAll( t ) ) + return NULL; + SbxVariable* pRes = NULL; + pObjs->SetFlag( SBX_EXTSEARCH ); + if( t == SbxCLASS_DONTCARE ) + { + pRes = pMethods->Find( rName, SbxCLASS_METHOD ); + if( !pRes ) + pRes = pProps->Find( rName, SbxCLASS_PROPERTY ); + if( !pRes ) + pRes = pObjs->Find( rName, t ); + } + else + { + SbxArray* pArray = NULL; + switch( t ) + { + case SbxCLASS_VARIABLE: + case SbxCLASS_PROPERTY: pArray = pProps; break; + case SbxCLASS_METHOD: pArray = pMethods; break; + case SbxCLASS_OBJECT: pArray = pObjs; break; + default: + DBG_ASSERT( !this, "Ungueltige SBX-Klasse" ); + } + if( pArray ) + pRes = pArray->Find( rName, t ); + } + // Extended Search im Objekt-Array? + // Fuer Objekte und DontCare ist das Objektarray bereits + // durchsucht worden + if( !pRes && ( t == SbxCLASS_METHOD || t == SbxCLASS_PROPERTY ) ) + pRes = pObjs->Find( rName, t ); + // Search in den Parents? + if( !pRes && IsSet( SBX_GBLSEARCH ) ) + { + SbxObject* pCur = this; + while( !pRes && pCur->pParent ) + { + // Ich selbst bin schon durchsucht worden! + USHORT nOwn = pCur->GetFlags(); + pCur->ResetFlag( SBX_EXTSEARCH ); + // Ich suche bereits global! + USHORT nPar = pCur->pParent->GetFlags(); + pCur->pParent->ResetFlag( SBX_GBLSEARCH ); + pRes = pCur->pParent->Find( rName, t ); + pCur->SetFlags( nOwn ); + pCur->pParent->SetFlags( nPar ); + pCur = pCur->pParent; + } + } +#ifdef DBG_UTIL + nLvl--; + if( pRes ) + { + rtl::OString aNameStr3(rtl::OUStringToOString(rName, RTL_TEXTENCODING_ASCII_US)); + rtl::OString aNameStr4(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); + DbgOutf( "SBX: Found %.*s %s in %s", + nLvl, " ", aNameStr3.getStr(), aNameStr4.getStr() ); + } +#endif + return pRes; +} + +// Kurzform: Die Parent-Kette wird durchsucht +// Das ganze rekursiv, da Call() ueberladen sein kann +// Qualified Names sind zugelassen + +BOOL SbxObject::Call( const XubString& rName, SbxArray* pParam ) +{ + SbxVariable* pMeth = FindQualified( rName, SbxCLASS_DONTCARE); + if( pMeth && pMeth->ISA(SbxMethod) ) + { + // FindQualified() koennte schon zugeschlagen haben! + if( pParam ) + pMeth->SetParameters( pParam ); + pMeth->Broadcast( SBX_HINT_DATAWANTED ); + pMeth->SetParameters( NULL ); + return TRUE; + } + SetError( SbxERR_NO_METHOD ); + return FALSE; +} + +SbxProperty* SbxObject::GetDfltProperty() +{ + if ( !pDfltProp && aDfltPropName.Len() ) + { + pDfltProp = (SbxProperty*) Find( aDfltPropName, SbxCLASS_PROPERTY ); + if( !pDfltProp ) + pDfltProp = (SbxProperty*) Make( aDfltPropName, SbxCLASS_PROPERTY, SbxVARIANT ); + } + return pDfltProp; +} + +// Suchen einer bereits vorhandenen Variablen. Falls sie gefunden wurde, +// wird der Index gesetzt, sonst wird der Count des Arrays geliefert. +// In jedem Fall wird das korrekte Array geliefert. + +SbxArray* SbxObject::FindVar( SbxVariable* pVar, USHORT& nArrayIdx ) +{ + SbxArray* pArray = NULL; + if( pVar ) switch( pVar->GetClass() ) + { + case SbxCLASS_VARIABLE: + case SbxCLASS_PROPERTY: pArray = pProps; break; + case SbxCLASS_METHOD: pArray = pMethods; break; + case SbxCLASS_OBJECT: pArray = pObjs; break; + default: + DBG_ASSERT( !this, "Ungueltige SBX-Klasse" ); + } + if( pArray ) + { + nArrayIdx = pArray->Count(); + // ist die Variable per Name vorhanden? + pArray->ResetFlag( SBX_EXTSEARCH ); + SbxVariable* pOld = pArray->Find( pVar->GetName(), pVar->GetClass() ); + if( pOld ) + for( USHORT i = 0; i < pArray->Count(); i++ ) + { + SbxVariableRef& rRef = pArray->GetRef( i ); + if( (SbxVariable*) rRef == pOld ) + { + nArrayIdx = i; break; + } + } + } + return pArray; +} + +// Falls ein neues Objekt eingerichtet wird, wird es, falls es bereits +// eines mit diesem Namen gibt, indiziert. + +SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataType dt ) +{ + // Ist das Objekt bereits vorhanden? + SbxArray* pArray = NULL; + switch( ct ) + { + case SbxCLASS_VARIABLE: + case SbxCLASS_PROPERTY: pArray = pProps; break; + case SbxCLASS_METHOD: pArray = pMethods; break; + case SbxCLASS_OBJECT: pArray = pObjs; break; + default: + DBG_ASSERT( !this, "Ungueltige SBX-Klasse" ); + } + if( !pArray ) + return NULL; + // Collections duerfen gleichnamige Objekte enthalten + if( !( ct == SbxCLASS_OBJECT && ISA(SbxCollection) ) ) + { + SbxVariable* pRes = pArray->Find( rName, ct ); + if( pRes ) + { + return pRes; + } + } + SbxVariable* pVar = NULL; + switch( ct ) + { + case SbxCLASS_VARIABLE: + case SbxCLASS_PROPERTY: + pVar = new SbxProperty( rName, dt ); + break; + case SbxCLASS_METHOD: + pVar = new SbxMethod( rName, dt ); + break; + case SbxCLASS_OBJECT: + pVar = CreateObject( rName ); + break; + default: break; + } + pVar->SetParent( this ); + pArray->Put( pVar, pArray->Count() ); + SetModified( TRUE ); + // Das Objekt lauscht immer + StartListening( pVar->GetBroadcaster(), TRUE ); + Broadcast( SBX_HINT_OBJECTCHANGED ); + return pVar; +} + +SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClass ) +{ + // Ist das Objekt bereits vorhanden? + if( !ISA(SbxCollection) ) + { + SbxVariable* pRes = pObjs->Find( rName, SbxCLASS_OBJECT ); + if( pRes ) + { + return PTR_CAST(SbxObject,pRes); + } + } + SbxObject* pVar = CreateObject( rClass ); + if( pVar ) + { + pVar->SetName( rName ); + pVar->SetParent( this ); + pObjs->Put( pVar, pObjs->Count() ); + SetModified( TRUE ); + // Das Objekt lauscht immer + StartListening( pVar->GetBroadcaster(), TRUE ); + Broadcast( SBX_HINT_OBJECTCHANGED ); + } + return pVar; +} + +void SbxObject::Insert( SbxVariable* pVar ) +{ + USHORT nIdx; + SbxArray* pArray = FindVar( pVar, nIdx ); + if( pArray ) + { + // Hinein damit. Man sollte allerdings auf die Pointer aufpassen! + if( nIdx < pArray->Count() ) + { + // dann gibt es dieses Element bereits + // Bei Collections duerfen gleichnamige Objekte hinein + if( pArray == pObjs && ISA(SbxCollection) ) + nIdx = pArray->Count(); + else + { + SbxVariable* pOld = pArray->Get( nIdx ); + // schon drin: ueberschreiben + if( pOld == pVar ) + return; + + EndListening( pOld->GetBroadcaster(), TRUE ); + if( pVar->GetClass() == SbxCLASS_PROPERTY ) + { + if( pOld == pDfltProp ) + pDfltProp = (SbxProperty*) pVar; + } + } + } + StartListening( pVar->GetBroadcaster(), TRUE ); + pArray->Put( pVar, nIdx ); + if( pVar->GetParent() != this ) + pVar->SetParent( this ); + SetModified( TRUE ); + Broadcast( SBX_HINT_OBJECTCHANGED ); +#ifdef DBG_UTIL + static const char* pCls[] = + { "DontCare","Array","Value","Variable","Method","Property","Object" }; + XubString aVarName( pVar->GetName() ); + if ( !aVarName.Len() && pVar->ISA(SbxObject) ) + aVarName = PTR_CAST(SbxObject,pVar)->GetClassName(); + rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US)); + rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); + DbgOutf( "SBX: Insert %s %s in %s", + ( pVar->GetClass() >= SbxCLASS_DONTCARE && + pVar->GetClass() <= SbxCLASS_OBJECT ) + ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr1.getStr() ); +#endif + } +} + +// AB 23.4.1997, Optimierung, Einfuegen ohne Ueberpruefung auf doppelte +// Eintraege und ohne Broadcasts, wird nur in SO2/auto.cxx genutzt +void SbxObject::QuickInsert( SbxVariable* pVar ) +{ + SbxArray* pArray = NULL; + if( pVar ) + { + switch( pVar->GetClass() ) + { + case SbxCLASS_VARIABLE: + case SbxCLASS_PROPERTY: pArray = pProps; break; + case SbxCLASS_METHOD: pArray = pMethods; break; + case SbxCLASS_OBJECT: pArray = pObjs; break; + default: + DBG_ASSERT( !this, "Ungueltige SBX-Klasse" ); + } + } + if( pArray ) + { + StartListening( pVar->GetBroadcaster(), TRUE ); + pArray->Put( pVar, pArray->Count() ); + if( pVar->GetParent() != this ) + pVar->SetParent( this ); + SetModified( TRUE ); +#ifdef DBG_UTIL + static const char* pCls[] = + { "DontCare","Array","Value","Variable","Method","Property","Object" }; + XubString aVarName( pVar->GetName() ); + if ( !aVarName.Len() && pVar->ISA(SbxObject) ) + aVarName = PTR_CAST(SbxObject,pVar)->GetClassName(); + rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US)); + rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); + DbgOutf( "SBX: Insert %s %s in %s", + ( pVar->GetClass() >= SbxCLASS_DONTCARE && + pVar->GetClass() <= SbxCLASS_OBJECT ) + ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr1.getStr() ); +#endif + } +} + +void SbxObject::Remove( const XubString& rName, SbxClassType t ) +{ + Remove( SbxObject::Find( rName, t ) ); +} + +void SbxObject::Remove( SbxVariable* pVar ) +{ + USHORT nIdx; + SbxArray* pArray = FindVar( pVar, nIdx ); + if( pArray && nIdx < pArray->Count() ) + { +#ifdef DBG_UTIL + XubString aVarName( pVar->GetName() ); + if ( !aVarName.Len() && pVar->ISA(SbxObject) ) + aVarName = PTR_CAST(SbxObject,pVar)->GetClassName(); + rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US)); + rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); +#endif + SbxVariableRef pVar_ = pArray->Get( nIdx ); + if( pVar_->IsBroadcaster() ) + EndListening( pVar_->GetBroadcaster(), TRUE ); + if( (SbxVariable*) pVar_ == pDfltProp ) + pDfltProp = NULL; + pArray->Remove( nIdx ); + if( pVar_->GetParent() == this ) + pVar_->SetParent( NULL ); + SetModified( TRUE ); + Broadcast( SBX_HINT_OBJECTCHANGED ); + } +} + +static BOOL LoadArray( SvStream& rStrm, SbxObject* pThis, SbxArray* pArray ) +{ + SbxArrayRef p = (SbxArray*) SbxBase::Load( rStrm ); + if( !p.Is() ) + return FALSE; + for( USHORT i = 0; i < p->Count(); i++ ) + { + SbxVariableRef& r = p->GetRef( i ); + SbxVariable* pVar = r; + if( pVar ) + { + pVar->SetParent( pThis ); + pThis->StartListening( pVar->GetBroadcaster(), TRUE ); + } + } + pArray->Merge( p ); + return TRUE; +} + +// Der Load eines Objekts ist additiv! + +BOOL SbxObject::LoadData( SvStream& rStrm, USHORT nVer ) +{ + // Hilfe fuer das Einlesen alter Objekte: einfach TRUE zurueck, + // LoadPrivateData() muss Default-Zustand herstellen + if( !nVer ) + return TRUE; + + pDfltProp = NULL; + if( !SbxVariable::LoadData( rStrm, nVer ) ) + return FALSE; + // Wenn kein fremdes Objekt enthalten ist, uns selbst eintragen + if( aData.eType == SbxOBJECT && !aData.pObj ) + aData.pObj = this; + sal_uInt32 nSize; + XubString aDfltProp; + rStrm.ReadByteString( aClassName, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aDfltProp, RTL_TEXTENCODING_ASCII_US ); + ULONG nPos = rStrm.Tell(); + rStrm >> nSize; + if( !LoadPrivateData( rStrm, nVer ) ) + return FALSE; + ULONG nNewPos = rStrm.Tell(); + nPos += nSize; + DBG_ASSERT( nPos >= nNewPos, "SBX: Zu viele Daten eingelesen" ); + if( nPos != nNewPos ) + rStrm.Seek( nPos ); + if( !LoadArray( rStrm, this, pMethods ) + || !LoadArray( rStrm, this, pProps ) + || !LoadArray( rStrm, this, pObjs ) ) + return FALSE; + // Properties setzen + if( aDfltProp.Len() ) + pDfltProp = (SbxProperty*) pProps->Find( aDfltProp, SbxCLASS_PROPERTY ); + SetModified( FALSE ); + return TRUE; +} + +XubString SbxObject::GenerateSource( const XubString &rLinePrefix, + const SbxObject* ) +{ + // Properties in einem String einsammeln + XubString aSource; + SbxArrayRef xProps( GetProperties() ); + bool bLineFeed = FALSE; + for ( USHORT nProp = 0; nProp < xProps->Count(); ++nProp ) + { + SbxPropertyRef xProp = (SbxProperty*) xProps->Get(nProp); + XubString aPropName( xProp->GetName() ); + if ( xProp->CanWrite() + && !( xProp->GetHashCode() == nNameHash + && aPropName.EqualsIgnoreCaseAscii( pNameProp ) ) ) + { + // ausser vor dem ersten Property immer einen Umbruch einfuegen + if ( bLineFeed ) + aSource.AppendAscii( "\n" ); + else + bLineFeed = TRUE; + + aSource += rLinePrefix; + aSource += '.'; + aSource += aPropName; + aSource.AppendAscii( " = " ); + + // den Property-Wert textuell darstellen + switch ( xProp->GetType() ) + { + case SbxEMPTY: + case SbxNULL: + // kein Wert + break; + + case SbxSTRING: + { + // Strings in Anf"uhrungszeichen + aSource.AppendAscii( "\"" ); + aSource += xProp->GetString(); + aSource.AppendAscii( "\"" ); + break; + } + + default: + { + // sonstiges wie z.B. Zahlen direkt + aSource += xProp->GetString(); + break; + } + } + } + } + return aSource; +} + +static BOOL CollectAttrs( const SbxBase* p, XubString& rRes ) +{ + XubString aAttrs; + if( p->IsHidden() ) + aAttrs.AssignAscii( "Hidden" ); + if( p->IsSet( SBX_EXTSEARCH ) ) + { + if( aAttrs.Len() ) + aAttrs += ','; + aAttrs.AppendAscii( "ExtSearch" ); + } + if( !p->IsVisible() ) + { + if( aAttrs.Len() ) + aAttrs += ','; + aAttrs.AppendAscii( "Invisible" ); + } + if( p->IsSet( SBX_DONTSTORE ) ) + { + if( aAttrs.Len() ) + aAttrs += ','; + aAttrs.AppendAscii( "DontStore" ); + } + if( aAttrs.Len() ) + { + rRes.AssignAscii( " (" ); + rRes += aAttrs; + rRes += ')'; + return TRUE; + } + else + { + rRes.Erase(); + return FALSE; + } +} + +void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) +{ + // Einr"uckung + static USHORT nLevel = 0; + if ( nLevel > 10 ) + { + rStrm << "" << endl; + return; + } + ++nLevel; + String aIndent; + for ( USHORT n = 1; n < nLevel; ++n ) + aIndent.AppendAscii( " " ); + + // ggf. Objekt vervollst"andigen + if ( bFill ) + GetAll( SbxCLASS_DONTCARE ); + + // Daten des Objekts selbst ausgeben + rtl::OString aNameStr(rtl::OUStringToOString(GetName(), RTL_TEXTENCODING_ASCII_US)); + rtl::OString aClassNameStr(rtl::OUStringToOString(aClassName, RTL_TEXTENCODING_ASCII_US)); + rStrm << "Object( " + << rtl::OString::valueOf(reinterpret_cast(this)).getStr() << "=='" + << ( aNameStr.getLength() ? aNameStr.getStr() : "" ) << "', " + << "of class '" << aClassNameStr.getStr() << "', " + << "counts " + << rtl::OString::valueOf(static_cast(GetRefCount())).getStr() + << " refs, "; + if ( GetParent() ) + { + rtl::OString aParentNameStr(rtl::OUStringToOString(GetName(), RTL_TEXTENCODING_ASCII_US)); + rStrm << "in parent " + << rtl::OString::valueOf(reinterpret_cast(GetParent())).getStr() + << "=='" << ( aParentNameStr.getLength() ? aParentNameStr.getStr() : "" ) << "'"; + } + else + rStrm << "no parent "; + rStrm << " )" << endl; + rtl::OString aIndentNameStr(rtl::OUStringToOString(aIndent, RTL_TEXTENCODING_ASCII_US)); + rStrm << aIndentNameStr.getStr() << "{" << endl; + + // Flags + XubString aAttrs; + if( CollectAttrs( this, aAttrs ) ) + { + rtl::OString aAttrStr(rtl::OUStringToOString(aAttrs, RTL_TEXTENCODING_ASCII_US)); + rStrm << aIndentNameStr.getStr() << "- Flags: " << aAttrStr.getStr() << endl; + } + + // Methods + rStrm << aIndentNameStr.getStr() << "- Methods:" << endl; + for( USHORT i = 0; i < pMethods->Count(); i++ ) + { + SbxVariableRef& r = pMethods->GetRef( i ); + SbxVariable* pVar = r; + if( pVar ) + { + XubString aLine( aIndent ); + aLine.AppendAscii( " - " ); + aLine += pVar->GetName( SbxNAME_SHORT_TYPES ); + XubString aAttrs2; + if( CollectAttrs( pVar, aAttrs2 ) ) + aLine += aAttrs2; + if( !pVar->IsA( TYPE(SbxMethod) ) ) + aLine.AppendAscii( " !! Not a Method !!" ); + rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US ); + + // bei Object-Methods auch das Object ausgeben + if ( pVar->GetValues_Impl().eType == SbxOBJECT && + pVar->GetValues_Impl().pObj && + pVar->GetValues_Impl().pObj != this && + pVar->GetValues_Impl().pObj != GetParent() ) + { + rStrm << " contains "; + ((SbxObject*) pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); + } + else + rStrm << endl; + } + } + + // Properties + rStrm << aIndentNameStr.getStr() << "- Properties:" << endl; + { + for( USHORT i = 0; i < pProps->Count(); i++ ) + { + SbxVariableRef& r = pProps->GetRef( i ); + SbxVariable* pVar = r; + if( pVar ) + { + XubString aLine( aIndent ); + aLine.AppendAscii( " - " ); + aLine += pVar->GetName( SbxNAME_SHORT_TYPES ); + XubString aAttrs3; + if( CollectAttrs( pVar, aAttrs3 ) ) + aLine += aAttrs3; + if( !pVar->IsA( TYPE(SbxProperty) ) ) + aLine.AppendAscii( " !! Not a Property !!" ); + rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US ); + + // bei Object-Properties auch das Object ausgeben + if ( pVar->GetValues_Impl().eType == SbxOBJECT && + pVar->GetValues_Impl().pObj && + pVar->GetValues_Impl().pObj != this && + pVar->GetValues_Impl().pObj != GetParent() ) + { + rStrm << " contains "; + ((SbxObject*) pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); + } + else + rStrm << endl; + } + } + } + + // Objects + rStrm << aIndentNameStr.getStr() << "- Objects:" << endl; + { + for( USHORT i = 0; i < pObjs->Count(); i++ ) + { + SbxVariableRef& r = pObjs->GetRef( i ); + SbxVariable* pVar = r; + if ( pVar ) + { + rStrm << aIndentNameStr.getStr() << " - Sub"; + if ( pVar->ISA(SbxObject) ) + ((SbxObject*) pVar)->Dump( rStrm, bFill ); + else if ( pVar->ISA(SbxVariable) ) + ((SbxVariable*) pVar)->Dump( rStrm, bFill ); + } + } + } + + rStrm << aIndentNameStr.getStr() << "}" << endl << endl; + --nLevel; +} + +SvDispatch* SbxObject::GetSvDispatch() +{ + return NULL; +} + +SbxClassType SbxMethod::GetClass() const +{ + return SbxCLASS_METHOD; +} + +SbxClassType SbxProperty::GetClass() const +{ + return SbxCLASS_PROPERTY; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxres.cxx b/bf_basic/source/sbx/sbxres.cxx new file mode 100644 index 00000000000..cb18dac111e --- /dev/null +++ b/bf_basic/source/sbx/sbxres.cxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sbxres.hxx" + +namespace binfilter { + +static const char* pSbxRes[] = { + "Empty", + "Null", + "Integer", + "Long", + "Single", + "Double", + "Currency", + "Date", + "String", + "Object", + "Error", + "Boolean", + "Variant", + "Any", + "Type14", + "Type15", + "Char", + "Byte", + "UShort", + "ULong", + "Long64", + "ULong64", + "Int", + "UInt", + "Void", + "HResult", + "Pointer", + "DimArray", + "CArray", + "Any", + "LpStr", + "LpWStr", + " As ", + "Optional ", + "Byref ", + + "Name", + "Parent", + "Application", + "Count", + "Add", + "Item", + "Remove", + + "Error ", // mit Blank! + "False", + "True" +}; + +const char* GetSbxRes( USHORT nId ) +{ + return ( ( nId > SBXRES_MAX ) ? "???" : pSbxRes[ nId ] ); +} + +SbxRes::SbxRes( USHORT nId ) + : XubString( String::CreateFromAscii( GetSbxRes( nId ) ) ) +{} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxres.hxx b/bf_basic/source/sbx/sbxres.hxx new file mode 100644 index 00000000000..25f0cabe469 --- /dev/null +++ b/bf_basic/source/sbx/sbxres.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SBXRES_HXX +#define _SBXRES_HXX + +#include + +#include + +// Zur Zeit sind Ressources im SVTOOLS-Projekt nicht vorgesehen. +// Da es sich um unkritische Ressourcen handelt (BASIC-Keywords), +// koennen wir mit Dummies arbeiten. + +#define STRING_TYPES 0 +#define STRING_EMPTY 0 +#define STRING_NULL 1 +#define STRING_INTEGER 2 +#define STRING_LONG 3 +#define STRING_SINGLE 4 +#define STRING_DOUBLE 5 +#define STRING_CURRENCY 6 +#define STRING_DATE 7 +#define STRING_STRING 8 +#define STRING_OBJECT 9 +#define STRING_ERROR 10 +#define STRING_BOOL 11 +#define STRING_VARIANT 12 +#define STRING_ANY 13 +#define STRING_CHAR 16 +#define STRING_BYTE 17 +#define STRING_USHORT 18 +#define STRING_ULONG 19 +#define STRING_INT 22 +#define STRING_UINT 23 +#define STRING_LPSTR 30 +#define STRING_LPWSTR 31 +#define STRING_AS 32 +#define STRING_OPTIONAL 33 +#define STRING_BYREF 34 + +#define STRING_NAMEPROP 35 +#define STRING_PARENTPROP 36 +#define STRING_APPLPROP 37 +#define STRING_COUNTPROP 38 +#define STRING_ADDMETH 39 +#define STRING_ITEMMETH 40 +#define STRING_REMOVEMETH 41 + +#define STRING_ERRORMSG 42 +#define STRING_FALSE 43 +#define STRING_TRUE 44 + +#define SBXRES_MAX 44 + +namespace binfilter { + +class SbxRes : public String +{ +public: + SbxRes( USHORT ); +}; + +const char* GetSbxRes( USHORT ); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxscan.cxx b/bf_basic/source/sbx/sbxscan.cxx new file mode 100644 index 00000000000..d6874e35148 --- /dev/null +++ b/bf_basic/source/sbx/sbxscan.cxx @@ -0,0 +1,518 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +#include "bf_svtools/syslocale.hxx" + +#if defined ( UNX ) +#include +#endif + +#include +#include +#include +#include +#include + +#include "sbxres.hxx" +#include + +namespace binfilter { + +void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ) +{ + SvtSysLocale aSysLocale; + const LocaleDataWrapper& rData = aSysLocale.GetLocaleData(); + rcDecimalSep = rData.getNumDecimalSep().GetBuffer()[0]; + rcThousandSep = rData.getNumThousandSep().GetBuffer()[0]; +} + +// Scannen eines Strings nach BASIC-Konventionen +// Dies entspricht den ueblichen Konventionen, nur dass der Exponent +// auch ein D sein darf, was den Datentyp auf SbxDOUBLE festlegt. +// Die Routine versucht, den Datentyp so klein wie moeglich zu gestalten. +// Das ganze gibt auch noch einen Konversionsfehler, wenn der Datentyp +// Fixed ist und das ganze nicht hineinpasst! + +SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType, + USHORT* pLen, BOOL bAllowIntntl, BOOL bOnlyIntntl ) +{ + rtl::OString aBStr(rtl::OUStringToOString(rWSrc, RTL_TEXTENCODING_ASCII_US)); + + // Bei International Komma besorgen + char cIntntlComma, cIntntl1000; + char cNonIntntlComma = '.'; + + sal_Unicode cDecimalSep, cThousandSep = 0; + if( bAllowIntntl || bOnlyIntntl ) + { + ImpGetIntntlSep( cDecimalSep, cThousandSep ); + cIntntlComma = (char)cDecimalSep; + cIntntl1000 = (char)cThousandSep; + } + // Sonst einfach auch auf . setzen + else + { + cIntntlComma = cNonIntntlComma; + cIntntl1000 = cNonIntntlComma; // Unschaedlich machen + } + // Nur International -> IntnlComma uebernehmen + if( bOnlyIntntl ) + { + cNonIntntlComma = cIntntlComma; + cIntntl1000 = (char)cThousandSep; + } + + const char* pStart = aBStr.getStr(); + const char* p = pStart; + char buf[ 80 ], *q = buf; + BOOL bRes = TRUE; + BOOL bMinus = FALSE; + nVal = 0; + SbxDataType eScanType = SbxSINGLE; + // Whitespace wech + while( *p &&( *p == ' ' || *p == '\t' ) ) p++; + // Zahl? Dann einlesen und konvertieren. + if( *p == '-' ) + p++, bMinus = TRUE; + if( isdigit( *p ) ||( (*p == cNonIntntlComma || *p == cIntntlComma || + *p == cIntntl1000) && isdigit( *(p+1 ) ) ) ) + { + short exp = 0; // >0: Exponentteil + short comma = 0; // >0: Nachkomma + short ndig = 0; // Anzahl Ziffern + short ncdig = 0; // Anzahl Ziffern nach Komma + rtl::OStringBuffer aSearchStr(RTL_CONSTASCII_STRINGPARAM( + "0123456789DEde")); + // Kommas ergaenzen + aSearchStr.append(cNonIntntlComma); + if( cIntntlComma != cNonIntntlComma ) + aSearchStr.append(cIntntlComma); + if( bOnlyIntntl ) + aSearchStr.append(cIntntl1000); + const char* pSearchStr = aSearchStr.getStr(); + while( strchr( pSearchStr, *p ) && *p ) + { + // 1000er-Trenner ueberlesen + if( bOnlyIntntl && *p == cIntntl1000 ) + { + p++; + continue; + } + + // Komma oder Exponent? + if( *p == cNonIntntlComma || *p == cIntntlComma ) + { + // Immer '.' einfuegen, damit atof funktioniert + p++; + if( ++comma > 1 ) + continue; + else + *q++ = '.'; + } + else if( strchr( "DdEe", *p ) ) + { + if( ++exp > 1 ) + { + p++; continue; + } + if( toupper( *p ) == 'D' ) + eScanType = SbxDOUBLE; + *q++ = 'E'; p++; + // Vorzeichen hinter Exponent? + if( *p == '+' ) + p++; + else + if( *p == '-' ) + *q++ = *p++; + } + else + { + *q++ = *p++; + if( comma && !exp ) ncdig++; + } + if( !exp ) ndig++; + } + *q = 0; + // Komma, Exponent mehrfach vorhanden? + if( comma > 1 || exp > 1 ) + bRes = FALSE; + // Kann auf Integer gefaltet werden? + if( !comma && !exp ) + { + if( nVal >= SbxMININT && nVal <= SbxMAXINT ) + eScanType = SbxINTEGER; + else if( nVal >= SbxMINLNG && nVal <= SbxMAXLNG ) + eScanType = SbxLONG; + } + + nVal = atof( buf ); + ndig = ndig - comma; + // zu viele Zahlen fuer SINGLE? + if( ndig > 15 || ncdig > 6 ) + eScanType = SbxDOUBLE; + + // Typkennung? + if( strchr( "%!&#", *p ) && *p ) p++; + } + // Hex/Oktalzahl? Einlesen und konvertieren: + else if( *p == '&' ) + { + p++; + eScanType = SbxLONG; + const char *cmp = "0123456789ABCDEF"; + char base = 16; + char ndig = 8; + char xch = *p++; + switch( toupper( xch ) ) + { + case 'O': cmp = "01234567"; base = 8; ndig = 11; break; + case 'H': break; + default : bRes = FALSE; + } + long l = 0; + int i; + while( isalnum( *p ) ) + { + char ch = sal::static_int_cast< char >( toupper( *p ) ); + p++; + if( strchr( cmp, ch ) ) *q++ = ch; + else bRes = FALSE; + } + *q = 0; + for( q = buf; *q; q++ ) + { + i =( *q & 0xFF ) - '0'; + if( i > 9 ) i -= 7; + l =( l * base ) + i; + if( !ndig-- ) + bRes = FALSE; + } + if( *p == '&' ) p++; + nVal = (double) l; + if( l >= SbxMININT && l <= SbxMAXINT ) + eScanType = SbxINTEGER; + } + if( pLen ) + *pLen = (USHORT) ( p - pStart ); + if( !bRes ) + return SbxERR_CONVERSION; + if( bMinus ) + nVal = -nVal; + rType = eScanType; + return SbxERR_OK; +} + +//////////////////////////////////////////////////////////////////////////// + +static double roundArray[] = { + 5.0e+0, 0.5e+0, 0.5e-1, 0.5e-2, 0.5e-3, 0.5e-4, 0.5e-5, 0.5e-6, 0.5e-7, + 0.5e-8, 0.5e-9, 0.5e-10,0.5e-11,0.5e-12,0.5e-13,0.5e-14,0.5e-15 }; + +/*************************************************************************** +|* +|* void myftoa( double, char *, short, short, BOOL, BOOL ) +|* +|* Beschreibung: Konversion double --> ASCII +|* Parameter: double die Zahl. +|* char * der Zielpuffer +|* short Anzahl Nachkommastellen +|* short Weite des Exponenten( 0=kein E ) +|* BOOL TRUE: mit 1000er Punkten +|* BOOL TRUE: formatfreie Ausgabe +|* +***************************************************************************/ + +static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth, + BOOL bPt, BOOL bFix, sal_Unicode cForceThousandSep = 0 ) +{ + + short nExp = 0; // Exponent + short nDig = nPrec + 1; // Anzahl Digits in Zahl + short nDec; // Anzahl Vorkommastellen + register int i, digit; + + // Komma besorgen + sal_Unicode cDecimalSep, cThousandSep; + ImpGetIntntlSep( cDecimalSep, cThousandSep ); + if( cForceThousandSep ) + cThousandSep = cForceThousandSep; + + // Exponentberechnung: + nExp = 0; + if( nNum > 0.0 ) + { + while( nNum < 1.0 ) nNum *= 10.0, nExp--; + while( nNum >= 10.0 ) nNum /= 10.0, nExp++; + } + if( !bFix && !nExpWidth ) + nDig = nDig + nExp; + else if( bFix && !nPrec ) + nDig = nExp + 1; + + // Zahl runden: + if( (nNum += roundArray [( nDig > 16 ) ? 16 : nDig] ) >= 10.0 ) + { + nNum = 1.0; + ++nExp; + if( !nExpWidth ) ++nDig; + } + + // Bestimmung der Vorkommastellen: + if( !nExpWidth ) + { + if( nExp < 0 ) + { + // #41691: Auch bei bFix eine 0 spendieren + *pBuf++ = '0'; + if( nPrec ) *pBuf++ = (char)cDecimalSep; + i = -nExp - 1; + if( nDig <= 0 ) i = nPrec; + while( i-- ) *pBuf++ = '0'; + nDec = 0; + } + else + nDec = nExp+1; + } + else + nDec = 1; + + // Zahl ausgeben: + if( nDig > 0 ) + { + for( i = 0 ; ; ++i ) + { + if( i < 16 ) + { + digit = (int) nNum; + *pBuf++ = sal::static_int_cast< char >(digit + '0'); + nNum =( nNum - digit ) * 10.0; + } else + *pBuf++ = '0'; + if( --nDig == 0 ) break; + if( nDec ) + { + nDec--; + if( !nDec ) + *pBuf++ = (char)cDecimalSep; + else if( !(nDec % 3 ) && bPt ) + *pBuf++ = (char)cThousandSep; + } + } + } + + // Exponent ausgeben: + if( nExpWidth ) + { + if( nExpWidth < 3 ) nExpWidth = 3; + nExpWidth -= 2; + *pBuf++ = 'E'; + *pBuf++ =( nExp < 0 ) ?( (nExp = -nExp ), '-' ) : '+'; + while( nExpWidth > 3 ) *pBuf++ = '0', nExpWidth--; + if( nExp >= 100 || nExpWidth == 3 ) + { + *pBuf++ = sal::static_int_cast< char >(nExp/100 + '0'); + nExp %= 100; + } + if( nExp/10 || nExpWidth >= 2 ) + *pBuf++ = sal::static_int_cast< char >(nExp/10 + '0'); + *pBuf++ = sal::static_int_cast< char >(nExp%10 + '0'); + } + *pBuf = 0; +} + +// Die Zahl wird unformatiert mit der angegebenen Anzahl NK-Stellen +// aufbereitet. Evtl. wird ein Minus vorangestellt. +// Diese Routine ist public, weil sie auch von den Put-Funktionen +// der Klasse SbxImpSTRING verwendet wird. + +#ifdef _MSC_VER +#pragma optimize( "", off ) +#pragma warning(disable: 4748) // "... because optimizations are disabled ..." +#endif + +void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString ) +{ + char *q; + char cBuf[ 40 ], *p = cBuf; + + sal_Unicode cDecimalSep, cThousandSep; + ImpGetIntntlSep( cDecimalSep, cThousandSep ); + if( bCoreString ) + cDecimalSep = '.'; + + if( nNum < 0.0 ) { + nNum = -nNum; + *p++ = '-'; + } + double dMaxNumWithoutExp = (nPrec == 6) ? 1E6 : 1E14; + myftoa( nNum, p, nPrec,( nNum &&( nNum < 1E-1 || nNum > dMaxNumWithoutExp ) ) ? 4:0, + FALSE, TRUE, cDecimalSep ); + // Trailing Zeroes weg: + for( p = cBuf; *p &&( *p != 'E' ); p++ ) {} + q = p; p--; + while( nPrec && *p == '0' ) nPrec--, p--; + if( *p == cDecimalSep ) p--; + while( *q ) *++p = *q++; + *++p = 0; + rRes = String::CreateFromAscii( cBuf ); +} + +#ifdef _MSC_VER +#pragma optimize( "", on ) +#endif + +// Formatierte Zahlenausgabe +// Der Returnwert ist die Anzahl Zeichen, die aus dem +// Format verwendt wurden. + +#ifdef _old_format_code_ +// lasse diesen Code vorl"aufig drin, zum 'abgucken' +// der bisherigen Implementation + +static USHORT printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt ) +{ + const String& rFmt = rWFmt; + char cFill = ' '; // Fuellzeichen + char cPre = 0; // Startzeichen( evtl. "$" ) + short nExpDig= 0; // Anzahl Exponentstellen + short nPrec = 0; // Anzahl Nachkommastellen + short nWidth = 0; // Zahlenweite gesamnt + short nLen; // Laenge konvertierte Zahl + BOOL bPoint = FALSE; // TRUE: mit 1000er Kommas + BOOL bTrail = FALSE; // TRUE, wenn folgendes Minus + BOOL bSign = FALSE; // TRUE: immer mit Vorzeichen + BOOL bNeg = FALSE; // TRUE: Zahl ist negativ + char cBuf [1024]; // Zahlenpuffer + char * p; + const char* pFmt = rFmt; + rRes.Erase(); + // $$ und ** abfangen. Einfach wird als Zeichen ausgegeben. + if( *pFmt == '$' ) + if( *++pFmt != '$' ) rRes += '$'; + if( *pFmt == '*' ) + if( *++pFmt != '*' ) rRes += '*'; + + switch( *pFmt++ ) + { + case 0: + break; + case '+': + bSign = TRUE; nWidth++; break; + case '*': + nWidth++; cFill = '*'; + if( *pFmt == '$' ) nWidth++, pFmt++, cPre = '$'; + break; + case '$': + nWidth++; cPre = '$'; break; + case '#': + case '.': + case ',': + pFmt--; break; + } + // Vorkomma: + for( ;; ) + { + while( *pFmt == '#' ) pFmt++, nWidth++; + // 1000er Kommas? + if( *pFmt == ',' ) + { + nWidth++; pFmt++; bPoint = TRUE; + } else break; + } + // Nachkomma: + if( *pFmt == '.' ) + { + while( *++pFmt == '#' ) nPrec++; + nWidth += nPrec + 1; + } + // Exponent: + while( *pFmt == '^' ) + pFmt++, nExpDig++, nWidth++; + // Folgendes Minus: + if( !bSign && *pFmt == '-' ) + pFmt++, bTrail = TRUE; + + // Zahl konvertieren: + if( nPrec > 15 ) nPrec = 15; + if( nNum < 0.0 ) nNum = -nNum, bNeg = TRUE; + p = cBuf; + if( bSign ) *p++ = bNeg ? '-' : '+'; + myftoa( nNum, p, nPrec, nExpDig, bPoint, FALSE ); + nLen = strlen( cBuf ); + + // Ueberlauf? + if( cPre ) nLen++; + if( nLen > nWidth ) rRes += '%'; + else { + nWidth -= nLen; + while( nWidth-- ) rRes += (xub_Unicode)cFill; + if( cPre ) rRes += (xub_Unicode)cPre; + } + rRes += (xub_Unicode*)&(cBuf[0]); + if( bTrail ) + rRes += bNeg ? '-' : ' '; + + return (USHORT) ( pFmt - (const char*) rFmt ); +} + +#endif //_old_format_code_ + +///////////////////////////////////////////////////////////////////////// + +BOOL SbxValue::Scan( const XubString& rSrc, USHORT* pLen ) +{ + SbxError eRes = SbxERR_OK; + if( !CanWrite() ) + eRes = SbxERR_PROP_READONLY; + else + { + double n; + SbxDataType t; + eRes = ImpScan( rSrc, n, t, pLen ); + if( eRes == SbxERR_OK ) + { + if( !IsFixed() ) + SetType( t ); + PutDouble( n ); + } + } + if( eRes ) + { + SetError( eRes ); return FALSE; + } + else + return TRUE; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxsng.cxx b/bf_basic/source/sbx/sbxsng.cxx new file mode 100644 index 00000000000..46041bc4587 --- /dev/null +++ b/bf_basic/source/sbx/sbxsng.cxx @@ -0,0 +1,358 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +float ImpGetSingle( const SbxValues* p ) +{ + SbxValues aTmp; + float nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + nRes = p->nInteger; break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; break; + case SbxLONG: + nRes = (float) p->nLong; break; + case SbxULONG: + nRes = (float) p->nULong; break; + case SbxSINGLE: + nRes = p->nSingle; break; + case SbxSALINT64: + nRes = (float) p->nInt64; break; + case SbxSALUINT64: + nRes = (float) ImpSalUInt64ToDouble( p->uInt64 ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + if( p->pDecimal ) + p->pDecimal->getSingle( nRes ); + else + nRes = 0.0; + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else + dVal = p->nDouble; + + if( dVal > SbxMAXSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + nRes = static_cast< float >(SbxMAXSNG); + } + else if( dVal < SbxMINSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + nRes = static_cast< float >(SbxMINSNG); + } + else if( dVal > 0 && dVal < SbxMAXSNG2 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + nRes = static_cast< float >(SbxMAXSNG2); + } + else if( dVal < 0 && dVal > SbxMINSNG2 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + nRes = static_cast< float >(SbxMINSNG2); + } + else + nRes = (float) dVal; + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + nRes = static_cast< float >(SbxMAXSNG); + } + else if( d < SbxMINSNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + nRes = static_cast< float >(SbxMINSNG); + } + else + nRes = (float) d; + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetSingle(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxCHAR: + nRes = *p->pChar; break; + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + nRes = *p->pInteger; break; + case SbxBYREF | SbxLONG: + nRes = (float) *p->pLong; break; + case SbxBYREF | SbxULONG: + nRes = (float) *p->pULong; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + nRes = *p->pUShort; break; + case SbxBYREF | SbxSINGLE: + nRes = *p->pSingle; break; + // ab hier muss getestet werden + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxSALINT64: + nRes = (float) *p->pnInt64; break; + case SbxBYREF | SbxSALUINT64: + nRes = (float) ImpSalUInt64ToDouble( *p->puInt64 ); break; + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutSingle( SbxValues* p, float n ) +{ + SbxValues aTmp; +start: + switch( +p->eType ) + { + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxLONG: + aTmp.pLong = &p->nLong; goto direct; + case SbxULONG: + aTmp.pULong = &p->nULong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxULONG64: + aTmp.pULong64 = &p->nULong64; goto direct; + case SbxLONG64: + case SbxCURRENCY: + aTmp.pLong64 = &p->nLong64; goto direct; + case SbxSALINT64: + aTmp.pnInt64 = &p->nInt64; goto direct; + case SbxSALUINT64: + aTmp.puInt64 = &p->uInt64; goto direct; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + SbxDecimal* pDec = ImpCreateDecimal( p ); + if( !pDec->setSingle( n ) ) + SbxBase::SetError( SbxERR_OVERFLOW ); + break; + } + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + // keine Tests ab hier + case SbxSINGLE: + p->nSingle = n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + { + if( !p->pString ) + p->pString = new XubString; + ImpCvtNum( (double) n, 6, *p->pString ); + break; + } + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutSingle( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR; + } + else if( n < SbxMINCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR; + } + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + else if( n < SbxMININT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + { + INT32 i; + if( n > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); i = SbxMAXLNG; + } + else if( n < SbxMINLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); i = SbxMINLNG; + } + else + { + i = sal::static_int_cast< INT32 >(n); + } + *p->pLong = i; break; + } + case SbxBYREF | SbxULONG: + { + UINT32 i; + if( n > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); i = SbxMAXULNG; + } + else if( n < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); i = 0; + } + else + { + i = sal::static_int_cast< UINT32 >(n); + } + *p->pULong = i; break; + } + case SbxBYREF | SbxSINGLE: + *p->pSingle = n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = (double) n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = ImpDoubleToSalInt64( (double) n ); break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = ImpDoubleToSalUInt64( (double) n ); break; + case SbxBYREF | SbxCURRENCY: + if( n > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + } + else if( n < SbxMINCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + } + *p->pLong64 = ImpDoubleToCurrency( n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxstr.cxx b/bf_basic/source/sbx/sbxstr.cxx new file mode 100644 index 00000000000..5f78e88d410 --- /dev/null +++ b/bf_basic/source/sbx/sbxstr.cxx @@ -0,0 +1,246 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" +#include "sbxres.hxx" + +namespace binfilter { + +// Die Konversion eines Items auf String wird ueber die Put-Methoden +// der einzelnen Datentypen abgewickelt, um doppelten Code zu vermeiden. + +XubString ImpGetString( const SbxValues* p ) +{ + SbxValues aTmp; + XubString aRes; + aTmp.eType = SbxSTRING; + aTmp.pString = &aRes; + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + break; + case SbxCHAR: + ImpPutChar( &aTmp, p->nChar ); break; + case SbxBYTE: + ImpPutByte( &aTmp, p->nByte ); break; + case SbxINTEGER: + ImpPutInteger( &aTmp, p->nInteger ); break; + case SbxBOOL: + ImpPutBool( &aTmp, p->nUShort ); break; + case SbxUSHORT: + ImpPutUShort( &aTmp, p->nUShort ); break; + case SbxLONG: + ImpPutLong( &aTmp, p->nLong ); break; + case SbxULONG: + ImpPutULong( &aTmp, p->nULong ); break; + case SbxSINGLE: + ImpPutSingle( &aTmp, p->nSingle ); break; + case SbxDOUBLE: + ImpPutDouble( &aTmp, p->nDouble ); break; + case SbxCURRENCY: + ImpPutCurrency( &aTmp, p->nLong64 ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + ImpPutDecimal( &aTmp, p->pDecimal ); break; + case SbxSALINT64: + ImpPutInt64( &aTmp, p->nInt64 ); break; + case SbxSALUINT64: + ImpPutUInt64( &aTmp, p->uInt64 ); break; + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( p->pString ) + aRes = *p->pString; + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + aRes = pVal->GetString(); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxERROR: + // Hier wird der String "Error n" erzeugt + aRes = SbxRes( STRING_ERRORMSG ); + aRes += p->nUShort; break; + case SbxDATE: + ImpPutDate( &aTmp, p->nDouble ); break; + + case SbxBYREF | SbxCHAR: + ImpPutChar( &aTmp, *p->pChar ); break; + case SbxBYREF | SbxBYTE: + ImpPutByte( &aTmp, *p->pByte ); break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + ImpPutInteger( &aTmp, *p->pInteger ); break; + case SbxBYREF | SbxLONG: + ImpPutLong( &aTmp, *p->pLong ); break; + case SbxBYREF | SbxULONG: + ImpPutULong( &aTmp, *p->pULong ); break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + ImpPutUShort( &aTmp, *p->pUShort ); break; + case SbxBYREF | SbxSINGLE: + ImpPutSingle( &aTmp, *p->pSingle ); break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + ImpPutDouble( &aTmp, *p->pDouble ); break; + case SbxBYREF | SbxCURRENCY: + ImpPutCurrency( &aTmp, *p->pLong64 ); break; + case SbxBYREF | SbxSALINT64: + ImpPutInt64( &aTmp, *p->pnInt64 ); break; + case SbxBYREF | SbxSALUINT64: + ImpPutUInt64( &aTmp, *p->puInt64 ); break; + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } + return aRes; +} + +// AB 10.4.97, neue Funktion fuer SbxValue::GetCoreString() +XubString ImpGetCoreString( const SbxValues* p ) +{ + // Vorerst nur fuer double + if( ( p->eType & (~SbxBYREF) ) == SbxDOUBLE ) + { + SbxValues aTmp; + XubString aRes; + aTmp.eType = SbxSTRING; + aTmp.pString = &aRes; + if( p->eType == SbxDOUBLE ) + ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/TRUE ); + else + ImpPutDouble( &aTmp, *p->pDouble, /*bCoreString=*/TRUE ); + return aRes; + } + else + return ImpGetString( p ); +} + +void ImpPutString( SbxValues* p, const XubString* n ) +{ + SbxValues aTmp; + aTmp.eType = SbxSTRING; + XubString* pTmp = NULL; + // Sicherheitshalber, falls ein NULL-Ptr kommt + if( !n ) + n = pTmp = new XubString; + aTmp.pString = (XubString*) n; + switch( +p->eType ) + { + case SbxCHAR: + p->nChar = ImpGetChar( &aTmp ); break; + case SbxBYTE: + p->nByte = ImpGetByte( &aTmp ); break; + case SbxINTEGER: + case SbxBOOL: + p->nInteger = ImpGetInteger( &aTmp ); break; + case SbxLONG: + p->nLong = ImpGetLong( &aTmp ); break; + case SbxULONG: + p->nULong = ImpGetULong( &aTmp ); break; + case SbxERROR: + case SbxUSHORT: + p->nUShort = ImpGetUShort( &aTmp ); break; + case SbxSINGLE: + p->nSingle = ImpGetSingle( &aTmp ); break; + case SbxDATE: + p->nDouble = ImpGetDate( &aTmp ); break; + case SbxDOUBLE: + p->nDouble = ImpGetDouble( &aTmp ); break; + case SbxULONG64: + p->nLong64 = ImpGetCurrency( &aTmp ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + releaseDecimalPtr( p->pDecimal ); + p->pDecimal = ImpGetDecimal( &aTmp ); break; + case SbxSALINT64: + p->nInt64 = ImpGetInt64( &aTmp ); break; + case SbxSALUINT64: + p->uInt64 = ImpGetUInt64( &aTmp ); break; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( n->Len() ) + { + if( !p->pString ) + p->pString = new XubString; + *p->pString = *n; + } + else + delete p->pString, p->pString = NULL; + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutString( *n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + *p->pChar = ImpGetChar( p ); break; + case SbxBYREF | SbxBYTE: + *p->pByte = ImpGetByte( p ); break; + case SbxBYREF | SbxINTEGER: + *p->pInteger = ImpGetInteger( p ); break; + case SbxBYREF | SbxBOOL: + *p->pUShort = sal::static_int_cast< UINT16 >( ImpGetBool( p ) ); + break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + *p->pUShort = ImpGetUShort( p ); break; + case SbxBYREF | SbxLONG: + *p->pLong = ImpGetLong( p ); break; + case SbxBYREF | SbxULONG: + *p->pULong = ImpGetULong( p ); break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = ImpGetSingle( p ); break; + case SbxBYREF | SbxDATE: + *p->pDouble = ImpGetDate( p ); break; + case SbxBYREF | SbxDOUBLE: + *p->pDouble = ImpGetDouble( p ); break; + case SbxBYREF | SbxCURRENCY: + *p->pLong64 = ImpGetCurrency( p ); break; + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } + delete pTmp; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxuint.cxx b/bf_basic/source/sbx/sbxuint.cxx new file mode 100644 index 00000000000..5f19d018fb9 --- /dev/null +++ b/bf_basic/source/sbx/sbxuint.cxx @@ -0,0 +1,335 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +UINT16 ImpGetUShort( const SbxValues* p ) +{ + SbxValues aTmp; + UINT16 nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; + break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + if( p->nInteger < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = p->nInteger; + break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; + break; + case SbxLONG: + if( p->nLong > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXUINT; + } + else if( p->nLong < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT16) p->nLong; + break; + case SbxULONG: + if( p->nULong > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXUINT; + } + else + nRes = (UINT16) p->nULong; + break; + case SbxSALINT64: + if( p->nInt64 > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXUINT; + } + else if( p->nInt64 < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT16) p->nInt64; + break; + case SbxSALUINT64: + if( p->uInt64 > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXUINT; + } + else + nRes = (UINT16) p->uInt64; + break; + case SbxSINGLE: + if( p->nSingle > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXUINT; + } + else if( p->nSingle < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT16) ( p->nSingle + 0.5 ); + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxCURRENCY: + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else if( p->eType == SbxDECIMAL ) + { + dVal = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( dVal ); + } + else + dVal = p->nDouble; + + if( dVal > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXUINT; + } + else if( dVal < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT16) ( dVal + 0.5 ); + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXUINT; + } + else if( d < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT16) ( d + 0.5 ); + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetUShort(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + nRes = *p->pUShort; break; + + // ab hier wird getestet + case SbxBYREF | SbxCHAR: + aTmp.nChar = *p->pChar; goto ref; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + aTmp.nInteger = *p->pInteger; goto ref; + case SbxBYREF | SbxLONG: + aTmp.nLong = *p->pLong; goto ref; + case SbxBYREF | SbxULONG: + aTmp.nULong = *p->pULong; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutUShort( SbxValues* p, UINT16 n ) +{ + SbxValues aTmp; + +start: + switch( +p->eType ) + { + case SbxERROR: + case SbxUSHORT: + p->nUShort = n; break; + case SbxLONG: + p->nLong = n; break; + case SbxULONG: + p->nULong = n; break; + case SbxSINGLE: + p->nSingle = n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + case SbxSALINT64: + p->nInt64 = n; break; + case SbxSALUINT64: + p->uInt64 = n; break; + case SbxULONG64: + p->nULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxLONG64: + p->nLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxCURRENCY: + p->nLong64 = ImpDoubleToCurrency( (double)n ); break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + ImpCreateDecimal( p )->setUInt( n ); + break; + + // Tests ab hier + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxBYTE: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + ImpCvtNum( (double) n, 0, *p->pString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutUShort( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + + case SbxBYREF | SbxCHAR: + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + *p->pUShort = n; break; + case SbxBYREF | SbxLONG: + *p->pLong = n; break; + case SbxBYREF | SbxULONG: + *p->pULong = n; break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = n; break; + case SbxBYREF | SbxULONG64: + *p->pULong64 = ImpDoubleToUINT64( (double)n ); break; + case SbxBYREF | SbxLONG64: + *p->pLong64 = ImpDoubleToINT64( (double)n ); break; + case SbxBYREF | SbxCURRENCY: + *p->pLong64 = ImpDoubleToCurrency( (double)n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxulng.cxx b/bf_basic/source/sbx/sbxulng.cxx new file mode 100644 index 00000000000..3585c83e6b1 --- /dev/null +++ b/bf_basic/source/sbx/sbxulng.cxx @@ -0,0 +1,320 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "sbx.hxx" +#include "sbxconv.hxx" + +namespace binfilter { + +UINT32 ImpGetULong( const SbxValues* p ) +{ + SbxValues aTmp; + UINT32 nRes; +start: + switch( +p->eType ) + { + case SbxNULL: + SbxBase::SetError( SbxERR_CONVERSION ); + case SbxEMPTY: + nRes = 0; break; + case SbxCHAR: + nRes = p->nChar; + break; + case SbxBYTE: + nRes = p->nByte; break; + case SbxINTEGER: + case SbxBOOL: + if( p->nInteger < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = p->nInteger; + break; + case SbxERROR: + case SbxUSHORT: + nRes = p->nUShort; + break; + case SbxLONG: + if( p->nLong < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = p->nLong; + break; + case SbxULONG: + nRes = p->nULong; break; + case SbxSINGLE: + if( p->nSingle > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXULNG; + } + else if( p->nSingle < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT32) ( p->nSingle + 0.5 ); + break; + case SbxDATE: + case SbxDOUBLE: + case SbxLONG64: + case SbxULONG64: + case SbxSALINT64: + case SbxSALUINT64: + case SbxCURRENCY: + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + { + double dVal; + if( p->eType == SbxCURRENCY ) + dVal = ImpCurrencyToDouble( p->nLong64 ); + else if( p->eType == SbxLONG64 ) + dVal = ImpINT64ToDouble( p->nLong64 ); + else if( p->eType == SbxULONG64 ) + dVal = ImpUINT64ToDouble( p->nULong64 ); + else if( p->eType == SbxSALINT64 ) + dVal = static_cast< double >(p->nInt64); + else if( p->eType == SbxSALUINT64 ) + dVal = ImpSalUInt64ToDouble( p->uInt64 ); + else if( p->eType == SbxDECIMAL ) + { + dVal = 0.0; + if( p->pDecimal ) + p->pDecimal->getDouble( dVal ); + } + else + dVal = p->nDouble; + + if( dVal > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXULNG; + } + else if( dVal < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT32) ( dVal + 0.5 ); + break; + } + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + nRes = 0; + else + { + double d; + SbxDataType t; + if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + nRes = 0; + else if( d > SbxMAXULNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXULNG; + } + else if( d < 0 ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; + } + else + nRes = (UINT32) ( d + 0.5 ); + } + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + nRes = pVal->GetULong(); + else + { + SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0; + } + break; + } + + case SbxBYREF | SbxBYTE: + nRes = *p->pByte; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + nRes = *p->pUShort; break; + case SbxBYREF | SbxULONG: + nRes = *p->pULong; break; + + // Tests ab hier + case SbxBYREF | SbxCHAR: + aTmp.nChar = *p->pChar; goto ref; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + aTmp.nInteger = *p->pInteger; goto ref; + case SbxBYREF | SbxLONG: + aTmp.nLong = *p->pLong; goto ref; + case SbxBYREF | SbxSINGLE: + aTmp.nSingle = *p->pSingle; goto ref; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + aTmp.nDouble = *p->pDouble; goto ref; + case SbxBYREF | SbxSALINT64: + aTmp.nInt64 = *p->pnInt64; goto ref; + case SbxBYREF | SbxSALUINT64: + aTmp.uInt64 = *p->puInt64; goto ref; + case SbxBYREF | SbxULONG64: + aTmp.nULong64 = *p->pULong64; goto ref; + case SbxBYREF | SbxLONG64: + case SbxBYREF | SbxCURRENCY: + aTmp.nLong64 = *p->pLong64; goto ref; + ref: + aTmp.eType = SbxDataType( p->eType & 0x0FFF ); + p = &aTmp; goto start; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; + } + return nRes; +} + +void ImpPutULong( SbxValues* p, UINT32 n ) +{ + SbxValues aTmp; +start: + switch( +p->eType ) + { + case SbxULONG: + p->nULong = n; break; + case SbxSINGLE: + p->nSingle = (float) n; break; + case SbxDATE: + case SbxDOUBLE: + p->nDouble = n; break; + case SbxSALINT64: + p->nInt64 = n; break; + case SbxSALUINT64: + p->uInt64 = n; break; + case SbxDECIMAL: + case SbxBYREF | SbxDECIMAL: + ImpCreateDecimal( p )->setULong( n ); + break; + + // Tests ab hier + case SbxCHAR: + aTmp.pChar = &p->nChar; goto direct; + case SbxUINT: + aTmp.pByte = &p->nByte; goto direct; + case SbxINTEGER: + case SbxBOOL: + aTmp.pInteger = &p->nInteger; goto direct; + case SbxLONG: + aTmp.pLong = &p->nLong; goto direct; + case SbxERROR: + case SbxUSHORT: + aTmp.pUShort = &p->nUShort; goto direct; + case SbxULONG64: + aTmp.pULong64 = &p->nULong64; goto direct; + case SbxLONG64: + case SbxCURRENCY: + aTmp.pLong64 = &p->nLong64; goto direct; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + + case SbxBYREF | SbxSTRING: + case SbxSTRING: + case SbxLPSTR: + if( !p->pString ) + p->pString = new XubString; + ImpCvtNum( (double) n, 0, *p->pString ); + break; + case SbxOBJECT: + { + SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); + if( pVal ) + pVal->PutULong( n ); + else + SbxBase::SetError( SbxERR_NO_OBJECT ); + break; + } + case SbxBYREF | SbxCHAR: + if( n > SbxMAXCHAR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR; + } + *p->pChar = (xub_Unicode) n; break; + case SbxBYREF | SbxBYTE: + if( n > SbxMAXBYTE ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; + } + *p->pByte = (BYTE) n; break; + case SbxBYREF | SbxINTEGER: + case SbxBYREF | SbxBOOL: + if( n > SbxMAXINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; + } + *p->pInteger = (INT16) n; break; + case SbxBYREF | SbxERROR: + case SbxBYREF | SbxUSHORT: + if( n > SbxMAXUINT ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; + } + *p->pUShort = (UINT16) n; break; + case SbxBYREF | SbxLONG: + if( n > SbxMAXLNG ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG; + } + *p->pLong = (INT32) n; break; + case SbxBYREF | SbxULONG: + *p->pULong = n; break; + case SbxBYREF | SbxSINGLE: + *p->pSingle = (float) n; break; + case SbxBYREF | SbxDATE: + case SbxBYREF | SbxDOUBLE: + *p->pDouble = n; break; + case SbxBYREF | SbxSALINT64: + *p->pnInt64 = n; break; + case SbxBYREF | SbxSALUINT64: + *p->puInt64 = n; break; + case SbxBYREF | SbxCURRENCY: + if( n > SbxMAXCURR ) + { + SbxBase::SetError( SbxERR_OVERFLOW ); + } + *p->pLong64 = ImpDoubleToCurrency( n ); break; + + default: + SbxBase::SetError( SbxERR_CONVERSION ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxvalue.cxx b/bf_basic/source/sbx/sbxvalue.cxx new file mode 100644 index 00000000000..79827620b48 --- /dev/null +++ b/bf_basic/source/sbx/sbxvalue.cxx @@ -0,0 +1,1591 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#define _TLBIGINT_INT64 +#include +#include + +#include "sbx.hxx" +#include "sbxconv.hxx" +#include + +namespace binfilter { + +TYPEINIT1(SbxValue,SbxBase) + +BigInt SbxINT64Converter::SbxINT64_2_BigInt( const SbxINT64 &r ) +{ + BigInt a10000 = 0x10000; + + BigInt aReturn( r.nHigh ); + if( r.nHigh ) + aReturn *= a10000; + aReturn += (USHORT)(r.nLow >> 16); + aReturn *= a10000; + aReturn += (USHORT)r.nLow; + return aReturn; +} + +BOOL SbxINT64Converter::BigInt_2_SbxINT64( const BigInt& b, SbxINT64 *p ) +{ + if( !b.IsLong() ) { + if( b.nLen > 4 || (b.nNum[3] & 0x8000) ) + return FALSE; + + p->nLow = ((UINT32)b.nNum[1] << 16) | (UINT32)b.nNum[0]; + p->nHigh = ((UINT32)b.nNum[3] << 16) | (UINT32)b.nNum[2]; + if( b.bIsNeg ) + p->CHS(); + } + else + p->Set( (INT32)b.nVal ); + + return TRUE; +} + +BigInt SbxINT64Converter::SbxUINT64_2_BigInt( const SbxUINT64 &r ) +{ + BigInt a10000 = 0x10000; + + BigInt aReturn(r.nHigh); + if( r.nHigh ) + aReturn *= a10000; + aReturn += (USHORT)(r.nLow >> 16); + aReturn *= a10000; + aReturn += (USHORT)r.nLow; + return aReturn; +} + +BOOL SbxINT64Converter::BigInt_2_SbxUINT64( const BigInt& b, SbxUINT64 *p ) +{ + if( b.bIsBig ) { + if( b.bIsNeg || b.nLen > 4 ) + return FALSE; + + p->nLow = ((UINT32)b.nNum[1] << 16) | (UINT32)b.nNum[0]; + p->nHigh = ((UINT32)b.nNum[3] << 16) | (UINT32)b.nNum[2]; + } + else { + if( b.nVal < 0 ) + return FALSE; + + p->Set( (UINT32)b.nVal ); + } + + return TRUE; +} + +/////////////////////////// SbxINT64 ///////////////////////////////////// +SbxINT64 &SbxINT64::operator -= ( const SbxINT64 &r ) +{ + BigInt b( SbxINT64Converter::SbxINT64_2_BigInt( *this ) ); + b -= SbxINT64Converter::SbxINT64_2_BigInt( r ); + SbxINT64Converter::BigInt_2_SbxINT64( b, this ); + return *this; +} +SbxINT64 &SbxINT64::operator += ( const SbxINT64 &r ) +{ + BigInt b( SbxINT64Converter::SbxINT64_2_BigInt( *this ) ); + b += SbxINT64Converter::SbxINT64_2_BigInt( r ); + SbxINT64Converter::BigInt_2_SbxINT64( b, this ); + return *this; +} +SbxINT64 &SbxINT64::operator *= ( const SbxINT64 &r ) +{ + BigInt b( SbxINT64Converter::SbxINT64_2_BigInt( *this ) ); + b *= SbxINT64Converter::SbxINT64_2_BigInt( r ); + SbxINT64Converter::BigInt_2_SbxINT64( b, this ); + return *this; +} +SbxINT64 &SbxINT64::operator %= ( const SbxINT64 &r ) +{ + BigInt b( SbxINT64Converter::SbxINT64_2_BigInt( *this ) ); + b %= SbxINT64Converter::SbxINT64_2_BigInt( r ); + SbxINT64Converter::BigInt_2_SbxINT64( b, this ); + return *this; +} +SbxINT64 &SbxINT64::operator /= ( const SbxINT64 &r ) +{ + BigInt b( SbxINT64Converter::SbxINT64_2_BigInt( *this ) ); + b /= SbxINT64Converter::SbxINT64_2_BigInt( r ); + SbxINT64Converter::BigInt_2_SbxINT64( b, this ); + return *this; +} +SbxINT64 &SbxINT64::operator &= ( const SbxINT64 &r ) +{ + nHigh &= r.nHigh; + nLow &= r.nLow; + return *this; +} +SbxINT64 &SbxINT64::operator |= ( const SbxINT64 &r ) +{ + nHigh |= r.nHigh; + nLow |= r.nLow; + return *this; +} +SbxINT64 &SbxINT64::operator ^= ( const SbxINT64 &r ) +{ + nHigh ^= r.nHigh; + nLow ^= r.nLow; + return *this; +} + +SbxINT64 operator - ( const SbxINT64 &l, const SbxINT64 &r ) +{ + SbxINT64 a(l); + a -= r; + return a; +} +SbxINT64 operator + ( const SbxINT64 &l, const SbxINT64 &r ) +{ + SbxINT64 a(l); + a += r; + return a; +} +SbxINT64 operator / ( const SbxINT64 &l, const SbxINT64 &r ) +{ + SbxINT64 a(l); + a /= r; + return a; +} +SbxINT64 operator % ( const SbxINT64 &l, const SbxINT64 &r ) +{ + SbxINT64 a(l); + a %= r; + return a; +} +SbxINT64 operator * ( const SbxINT64 &l, const SbxINT64 &r ) +{ + SbxINT64 a(l); + a *= r; + return a; +} +SbxINT64 operator & ( const SbxINT64 &l, const SbxINT64 &r ) +{ + SbxINT64 a; + a.nHigh = r.nHigh & l.nHigh; + a.nLow = r.nLow & l.nLow; + return a; +} +SbxINT64 operator | ( const SbxINT64 &l, const SbxINT64 &r ) +{ + SbxINT64 a; + a.nHigh = r.nHigh | l.nHigh; + a.nLow = r.nLow | l.nLow; + return a; +} +SbxINT64 operator ^ ( const SbxINT64 &r, const SbxINT64 &l ) +{ + SbxINT64 a; + a.nHigh = r.nHigh ^ l.nHigh; + a.nLow = r.nLow ^ l.nLow; + return a; +} + +SbxINT64 operator - ( const SbxINT64 &r ) +{ + SbxINT64 a( r ); + a.CHS(); + return a; +} +SbxINT64 operator ~ ( const SbxINT64 &r ) +{ + SbxINT64 a; + a.nHigh = ~r.nHigh; + a.nLow = ~r.nLow; + return a; +} + +SbxUINT64 &SbxUINT64::operator %= ( const SbxUINT64 &r ) +{ + BigInt b( SbxINT64Converter::SbxUINT64_2_BigInt( *this ) ); + b %= SbxINT64Converter::SbxUINT64_2_BigInt( r ); + SbxINT64Converter::BigInt_2_SbxUINT64( b, this ); + return *this; +} +SbxUINT64 &SbxUINT64::operator /= ( const SbxUINT64 &r ) +{ + BigInt b( SbxINT64Converter::SbxUINT64_2_BigInt( *this ) ); + b /= SbxINT64Converter::SbxUINT64_2_BigInt( r ); + SbxINT64Converter::BigInt_2_SbxUINT64( b, this ); + return *this; +} +/////////////////////////// Fehlerbehandlung ///////////////////////////// + +#ifdef _USED +// NOCH NACHZUBAUEN! + +// Das Default-Handling setzt nur den Fehlercode. + +#ifndef WNT +#if defined ( UNX ) +int matherr( struct exception* p ) +#else +int matherr( struct _exception* p ) +#endif +{ + switch( p->type ) + { +#if defined ( UNX ) + case OVERFLOW: SbxBase::SetError( SbxERR_OVERFLOW ); break; +#else + case _OVERFLOW: SbxBase::SetError( SbxERR_OVERFLOW ); break; +#endif + default: SbxBase::SetError( SbxERR_NOTIMP ); break; + } + return TRUE; +} +#endif + +#endif // _USED + + +///////////////////////////// Konstruktoren ////////////////////////////// + +SbxValue::SbxValue() : SbxBase() +{ + aData.eType = SbxEMPTY; +} + +SbxValue::SbxValue( SbxDataType t, void* p ) : SbxBase() +{ + int n = t & 0x0FFF; + if( p ) + n |= SbxBYREF; + if( n == SbxVARIANT ) + n = SbxEMPTY; + else + SetFlag( SBX_FIXED ); + if( p ) + switch( t & 0x0FFF ) + { + case SbxINTEGER: n |= SbxBYREF; aData.pInteger = (INT16*) p; break; + case SbxULONG64: n |= SbxBYREF; aData.pULong64 = (SbxUINT64*) p; break; + case SbxLONG64: + case SbxCURRENCY: n |= SbxBYREF; aData.pLong64 = (SbxINT64*) p; break; + case SbxLONG: n |= SbxBYREF; aData.pLong = (INT32*) p; break; + case SbxSINGLE: n |= SbxBYREF; aData.pSingle = (float*) p; break; + case SbxDATE: + case SbxDOUBLE: n |= SbxBYREF; aData.pDouble = (double*) p; break; + case SbxSTRING: n |= SbxBYREF; aData.pString = (XubString*) p; break; + case SbxERROR: + case SbxUSHORT: + case SbxBOOL: n |= SbxBYREF; aData.pUShort = (UINT16*) p; break; + case SbxULONG: n |= SbxBYREF; aData.pULong = (UINT32*) p; break; + case SbxCHAR: n |= SbxBYREF; aData.pChar = (xub_Unicode*) p; break; + case SbxBYTE: n |= SbxBYREF; aData.pByte = (BYTE*) p; break; + case SbxINT: n |= SbxBYREF; aData.pInt = (int*) p; break; + case SbxOBJECT: + aData.pObj = (SbxBase*) p; + if( p ) + aData.pObj->AddRef(); + break; + case SbxDECIMAL: + aData.pDecimal = (SbxDecimal*) p; + if( p ) + aData.pDecimal->addRef(); + break; + default: + DBG_ASSERT( !this, "Angabe eines Pointers unzulaessig" ); + n = SbxNULL; + } + else + memset( &aData, 0, sizeof( SbxValues ) ); + aData.eType = SbxDataType( n ); +} + +SbxValue::SbxValue( const SbxValue& r ) + : SvRefBase( r ), SbxBase( r ) +{ + if( !r.CanRead() ) + { + SetError( SbxERR_PROP_WRITEONLY ); + if( !IsFixed() ) + aData.eType = SbxNULL; + } + else + { + ((SbxValue*) &r)->Broadcast( SBX_HINT_DATAWANTED ); + aData = r.aData; + // Pointer kopieren, Referenzen inkrementieren + switch( aData.eType ) + { + case SbxSTRING: + if( aData.pString ) + aData.pString = new XubString( *aData.pString ); + break; + case SbxOBJECT: + if( aData.pObj ) + aData.pObj->AddRef(); + break; + case SbxDECIMAL: + if( aData.pDecimal ) + aData.pDecimal->addRef(); + break; + default: break; + } + } +} + +SbxValue& SbxValue::operator=( const SbxValue& r ) +{ + if( &r != this ) + { + if( !CanWrite() ) + SetError( SbxERR_PROP_READONLY ); + else + { + // Den Inhalt der Variablen auslesen + SbxValues aNew; + if( IsFixed() ) + // fest: dann muss der Typ stimmen + aNew.eType = aData.eType; + else if( r.IsFixed() ) + // Quelle fest: Typ uebernehmen + aNew.eType = SbxDataType( r.aData.eType & 0x0FFF ); + else + // beides Variant: dann isses egal + aNew.eType = SbxVARIANT; + if( r.Get( aNew ) ) + Put( aNew ); + } + } + return *this; +} + +SbxValue::~SbxValue() +{ +#ifndef C50 + Broadcast( SBX_HINT_DYING ); + SetFlag( SBX_WRITE ); + SbxValue::Clear(); +#else + // Provisorischer Fix fuer Solaris 5.0 Compiler Bug + // bei Nutzung virtueller Vererbung. Virtuelle Calls + // im Destruktor vermeiden. Statt Clear() zu rufen + // moegliche Objekt-Referenzen direkt freigeben. + if( aData.eType == SbxOBJECT ) + { + if( aData.pObj && aData.pObj != this ) + { + HACK(nicht bei Parent-Prop - sonst CyclicRef) + SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); + BOOL bParentProp = pThisVar && 5345 == + ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ); + if ( !bParentProp ) + aData.pObj->ReleaseRef(); + } + } + else if( aData.eType == SbxDECIMAL ) + { + releaseDecimalPtr( aData.pDecimal ); + } +#endif +} + +void SbxValue::Clear() +{ + switch( aData.eType ) + { + case SbxNULL: + case SbxEMPTY: + case SbxVOID: + break; + case SbxSTRING: + delete aData.pString; aData.pString = NULL; + break; + case SbxOBJECT: + if( aData.pObj ) + { + if( aData.pObj != this ) + { + HACK(nicht bei Parent-Prop - sonst CyclicRef) + SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); + BOOL bParentProp = pThisVar && 5345 == + ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ); + if ( !bParentProp ) + aData.pObj->ReleaseRef(); + } + aData.pObj = NULL; + } + break; + case SbxDECIMAL: + if( aData.eType == SbxDECIMAL ) + releaseDecimalPtr( aData.pDecimal ); + break; + case SbxDATAOBJECT: + aData.pData = NULL; break; + default: + { + SbxValues aEmpty; + memset( &aEmpty, 0, sizeof( SbxValues ) ); + aEmpty.eType = GetType(); + Put( aEmpty ); + } + } +} + +// Dummy + +void SbxValue::Broadcast( ULONG ) +{} + +//////////////////////////// Daten auslesen ////////////////////////////// + +// Ermitteln der "richtigen" Variablen. Falls es ein Objekt ist, wird +// entweder das Objekt selbst oder dessen Default-Property angesprochen. +// Falls die Variable eine Variable oder ein Objekt enthaelt, wird +// dieses angesprochen. + +SbxValue* SbxValue::TheRealValue() const +{ + return TheRealValue( TRUE ); +} + +// #55226 Zusaetzliche Info transportieren +SbxValue* SbxValue::TheRealValue( BOOL bObjInObjError ) const +{ + SbxValue* p = (SbxValue*) this; + for( ;; ) + { + SbxDataType t = SbxDataType( p->aData.eType & 0x0FFF ); + if( t == SbxOBJECT ) + { + // Der Block enthaelt ein Objekt oder eine Variable + SbxObject* pObj = PTR_CAST(SbxObject,p->aData.pObj); + if( pObj ) + { + // Hat das Objekt eine Default-Property? + SbxVariable* pDflt = pObj->GetDfltProperty(); + + // Falls dies ein Objekt ist und sich selbst enthaelt, + // koennen wir nicht darauf zugreifen + // #55226# Die alte Bedingung, um einen Fehler zu setzen, + // ist nicht richtig, da z.B. eine ganz normale Variant- + // Variable mit Objekt davon betroffen sein kann, wenn ein + // anderer Wert zugewiesen werden soll. Daher mit Flag. + if( bObjInObjError && !pDflt && + ((SbxValue*) pObj)->aData.eType == SbxOBJECT && + ((SbxValue*) pObj)->aData.pObj == pObj ) + { + SetError( SbxERR_BAD_PROP_VALUE ); + p = NULL; + } + else if( pDflt ) + p = pDflt; + /* ALT: + else + p = pDflt ? pDflt : (SbxVariable*) pObj; + */ + break; + } + // Haben wir ein Array? + SbxArray* pArray = PTR_CAST(SbxArray,p->aData.pObj); + if( pArray ) + { + // Ggf. Parameter holen + SbxArray* pPar = NULL; + SbxVariable* pVar = PTR_CAST(SbxVariable,p); + if( pVar ) + pPar = pVar->GetParameters(); + if( pPar ) + { + // Haben wir ein dimensioniertes Array? + SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,p->aData.pObj); + if( pDimArray ) + p = pDimArray->Get( pPar ); + else + p = pArray->Get( pPar->Get( 1 )->GetInteger() ); + break; + } + } + // Sonst einen SbxValue annehmen + SbxValue* pVal = PTR_CAST(SbxValue,p->aData.pObj); + if( pVal ) + p = pVal; + else + break; + } + else + break; + } + return p; +} + +BOOL SbxValue::Get( SbxValues& rRes ) const +{ + BOOL bRes = FALSE; + SbxError eOld = GetError(); + if( eOld != SbxERR_OK ) + ResetError(); + if( !CanRead() ) + { + SetError( SbxERR_PROP_WRITEONLY ); + rRes.pObj = NULL; + } + else + { + // Falls nach einem Objekt oder einem VARIANT gefragt wird, nicht + // die wahren Werte suchen + SbxValue* p = (SbxValue*) this; + if( rRes.eType != SbxOBJECT && rRes.eType != SbxVARIANT ) + p = TheRealValue(); + if( p ) + { + p->Broadcast( SBX_HINT_DATAWANTED ); + switch( rRes.eType ) + { + case SbxEMPTY: + case SbxVOID: + case SbxNULL: break; + case SbxVARIANT: rRes = p->aData; break; + case SbxINTEGER: rRes.nInteger = ImpGetInteger( &p->aData ); break; + case SbxLONG: rRes.nLong = ImpGetLong( &p->aData ); break; + case SbxSALINT64: rRes.nInt64 = ImpGetInt64( &p->aData ); break; + case SbxSALUINT64: rRes.uInt64 = ImpGetUInt64( &p->aData ); break; + case SbxSINGLE: rRes.nSingle = ImpGetSingle( &p->aData ); break; + case SbxDOUBLE: rRes.nDouble = ImpGetDouble( &p->aData ); break; + case SbxCURRENCY:rRes.nLong64 = ImpGetCurrency( &p->aData ); break; + case SbxDECIMAL: rRes.pDecimal = ImpGetDecimal( &p->aData ); break; + case SbxDATE: rRes.nDouble = ImpGetDate( &p->aData ); break; + case SbxBOOL: + rRes.nUShort = sal::static_int_cast< UINT16 >( + ImpGetBool( &p->aData ) ); + break; + case SbxCHAR: rRes.nChar = ImpGetChar( &p->aData ); break; + case SbxBYTE: rRes.nByte = ImpGetByte( &p->aData ); break; + case SbxUSHORT: rRes.nUShort = ImpGetUShort( &p->aData ); break; + case SbxULONG: rRes.nULong = ImpGetULong( &p->aData ); break; + case SbxLPSTR: + case SbxSTRING: p->aPic = ImpGetString( &p->aData ); + rRes.pString = &p->aPic; break; + case SbxCoreSTRING: p->aPic = ImpGetCoreString( &p->aData ); + rRes.pString = &p->aPic; break; + case SbxINT: +#if SAL_TYPES_SIZEOFINT == 2 + rRes.nInt = (int) ImpGetInteger( &p->aData ); +#else + rRes.nInt = (int) ImpGetLong( &p->aData ); +#endif + break; + case SbxUINT: +#if SAL_TYPES_SIZEOFINT == 2 + rRes.nUInt = (int) ImpGetUShort( &p->aData ); +#else + rRes.nUInt = (int) ImpGetULong( &p->aData ); +#endif + break; + case SbxOBJECT: + if( p->aData.eType == SbxOBJECT ) + rRes.pObj = p->aData.pObj; + else + { + SetError( SbxERR_NO_OBJECT ); + rRes.pObj = NULL; + } + break; + default: + if( p->aData.eType == rRes.eType ) + rRes = p->aData; + else + { + SetError( SbxERR_CONVERSION ); + rRes.pObj = NULL; + } + } + } + else + { + // Objekt enthielt sich selbst + SbxDataType eTemp = rRes.eType; + memset( &rRes, 0, sizeof( SbxValues ) ); + rRes.eType = eTemp; + } + } + if( !IsError() ) + { + bRes = TRUE; + if( eOld != SbxERR_OK ) + SetError( eOld ); + } + return bRes; +} + +const XubString& SbxValue::GetString() const +{ + SbxValues aRes; + aRes.eType = SbxSTRING; + if( Get( aRes ) ) + // Geht in Ordnung, da Ptr eine Kopie ist + return *aRes.pString; + else + { + ((SbxValue*) this)->aPic.Erase(); + return aPic; + } +} + +BOOL SbxValue::GetBool() const +{ + SbxValues aRes; + aRes.eType = SbxBOOL; + Get( aRes ); + return BOOL( aRes.nUShort != 0 ); +} + +#define GET( g, e, t, m ) \ +t SbxValue::g() const { SbxValues aRes(e); Get( aRes ); return aRes.m; } + +GET( GetByte, SbxBYTE, BYTE, nByte ) +GET( GetChar, SbxCHAR, xub_Unicode, nChar ) +GET( GetCurrency, SbxCURRENCY, SbxINT64, nLong64 ) +GET( GetDate, SbxDATE, double, nDouble ) +GET( GetDouble, SbxDOUBLE, double, nDouble ) +GET( GetInteger, SbxINTEGER, INT16, nInteger ) +GET( GetLong, SbxLONG, INT32, nLong ) +GET( GetObject, SbxOBJECT, SbxBase*, pObj ) +GET( GetSingle, SbxSINGLE, float, nSingle ) +GET( GetULong, SbxULONG, UINT32, nULong ) +GET( GetUShort, SbxUSHORT, UINT16, nUShort ) +GET( GetInt64, SbxSALINT64, sal_Int64, nInt64 ) +GET( GetUInt64, SbxSALUINT64, sal_uInt64, uInt64 ) +#ifdef WNT +GET( GetDecimal, SbxDECIMAL, SbxDecimal*, pDecimal ) +#endif + +//////////////////////////// Daten schreiben ///////////////////////////// + +BOOL SbxValue::Put( const SbxValues& rVal ) +{ + BOOL bRes = FALSE; + SbxError eOld = GetError(); + if( eOld != SbxERR_OK ) + ResetError(); + if( !CanWrite() ) + SetError( SbxERR_PROP_READONLY ); + else if( rVal.eType & 0xF000 ) + SetError( SbxERR_NOTIMP ); + else + { + // Falls nach einem Objekt gefragt wird, nicht + // die wahren Werte suchen + SbxValue* p = this; + if( rVal.eType != SbxOBJECT ) + p = TheRealValue( FALSE ); // #55226 Hier keinen Fehler erlauben + if( p ) + { + if( !p->CanWrite() ) + SetError( SbxERR_PROP_READONLY ); + else if( p->IsFixed() || p->SetType( (SbxDataType) ( rVal.eType & 0x0FFF ) ) ) + switch( rVal.eType & 0x0FFF ) + { + case SbxEMPTY: + case SbxVOID: + case SbxNULL: break; + case SbxINTEGER: ImpPutInteger( &p->aData, rVal.nInteger ); break; + case SbxLONG: ImpPutLong( &p->aData, rVal.nLong ); break; + case SbxSALINT64: ImpPutInt64( &p->aData, rVal.nInt64 ); break; + case SbxSALUINT64: ImpPutUInt64( &p->aData, rVal.uInt64 ); break; + case SbxSINGLE: ImpPutSingle( &p->aData, rVal.nSingle ); break; + case SbxDOUBLE: ImpPutDouble( &p->aData, rVal.nDouble ); break; + case SbxCURRENCY: ImpPutCurrency( &p->aData, rVal.nLong64 ); break; + case SbxDECIMAL: ImpPutDecimal( &p->aData, rVal.pDecimal ); break; + case SbxDATE: ImpPutDate( &p->aData, rVal.nDouble ); break; + case SbxBOOL: ImpPutBool( &p->aData, rVal.nInteger ); break; + case SbxCHAR: ImpPutChar( &p->aData, rVal.nChar ); break; + case SbxBYTE: ImpPutByte( &p->aData, rVal.nByte ); break; + case SbxUSHORT: ImpPutUShort( &p->aData, rVal.nUShort ); break; + case SbxULONG: ImpPutULong( &p->aData, rVal.nULong ); break; + case SbxLPSTR: + case SbxSTRING: ImpPutString( &p->aData, rVal.pString ); break; + case SbxINT: +#if SAL_TYPES_SIZEOFINT == 2 + ImpPutInteger( &p->aData, (INT16) rVal.nInt ); +#else + ImpPutLong( &p->aData, (INT32) rVal.nInt ); +#endif + break; + case SbxUINT: +#if SAL_TYPES_SIZEOFINT == 2 + ImpPutUShort( &p->aData, (UINT16) rVal.nUInt ); +#else + ImpPutULong( &p->aData, (UINT32) rVal.nUInt ); +#endif + break; + case SbxOBJECT: + if( !p->IsFixed() || p->aData.eType == SbxOBJECT ) + { + // ist schon drin + if( p->aData.eType == SbxOBJECT && p->aData.pObj == rVal.pObj ) + break; + + // Nur den Werteteil loeschen! + p->SbxValue::Clear(); + + // eingentliche Zuweisung + p->aData.pObj = rVal.pObj; + + // ggf. Ref-Count mitzaehlen + if( p->aData.pObj && p->aData.pObj != p ) + { + if ( p != this ) + { + OSL_FAIL( "TheRealValue" ); + } + HACK(nicht bei Parent-Prop - sonst CyclicRef) + SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); + BOOL bParentProp = pThisVar && 5345 == + ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ); + if ( !bParentProp ) + p->aData.pObj->AddRef(); + } + } + else + SetError( SbxERR_CONVERSION ); + break; + default: + if( p->aData.eType == rVal.eType ) + p->aData = rVal; + else + { + SetError( SbxERR_CONVERSION ); + if( !p->IsFixed() ) + p->aData.eType = SbxNULL; + } + } + if( !IsError() ) + { + p->SetModified( TRUE ); + p->Broadcast( SBX_HINT_DATACHANGED ); + if( eOld != SbxERR_OK ) + SetError( eOld ); + bRes = TRUE; + } + } + } + return bRes; +} + +BOOL SbxValue::PutBool( BOOL b ) +{ + SbxValues aRes; + aRes.eType = SbxBOOL; + aRes.nUShort = sal::static_int_cast< UINT16 >(b ? SbxTRUE : SbxFALSE); + Put( aRes ); + return BOOL( !IsError() ); +} + +BOOL SbxValue::PutEmpty() +{ + BOOL bRet = SetType( SbxEMPTY ); + SetModified( TRUE ); + return bRet; +} + +BOOL SbxValue::PutString( const XubString& r ) +{ + SbxValues aRes; + aRes.eType = SbxSTRING; + aRes.pString = (XubString*) &r; + Put( aRes ); + return BOOL( !IsError() ); +} + +#define PUT( p, e, t, m ) \ +BOOL SbxValue::p( t n ) \ +{ SbxValues aRes(e); aRes.m = n; Put( aRes ); return BOOL( !IsError() ); } + +PUT( PutByte, SbxBYTE, BYTE, nByte ) +PUT( PutChar, SbxCHAR, xub_Unicode, nChar ) +PUT( PutCurrency, SbxCURRENCY, const SbxINT64&, nLong64 ) +PUT( PutDate, SbxDATE, double, nDouble ) +PUT( PutDouble, SbxDOUBLE, double, nDouble ) +PUT( PutInteger, SbxINTEGER, INT16, nInteger ) +PUT( PutLong, SbxLONG, INT32, nLong ) +PUT( PutObject, SbxOBJECT, SbxBase*, pObj ) +PUT( PutSingle, SbxSINGLE, float, nSingle ) +PUT( PutULong, SbxULONG, UINT32, nULong ) +PUT( PutUShort, SbxUSHORT, UINT16, nUShort ) +PUT( PutInt64, SbxSALINT64, sal_Int64, nInt64 ) +PUT( PutUInt64, SbxSALUINT64, sal_uInt64, uInt64 ) +#ifdef WNT +PUT( PutDecimal, SbxDECIMAL, SbxDecimal*, pDecimal ) +#endif + +////////////////////////// Setzen des Datentyps /////////////////////////// + +BOOL SbxValue::IsFixed() const +{ + return ( (GetFlags() & SBX_FIXED) | (aData.eType & SbxBYREF) ) != 0; +} + +// Eine Variable ist numerisch, wenn sie EMPTY oder wirklich numerisch ist +// oder einen vollstaendig konvertierbaren String enthaelt + +// #41692, fuer RTL und Basic-Core getrennt implementieren +BOOL SbxValue::IsNumeric() const +{ + return ImpIsNumeric( /*bOnlyIntntl*/FALSE ); +} + +BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const +{ + + if( !CanRead() ) + { + SetError( SbxERR_PROP_WRITEONLY ); return FALSE; + } + // Downcast pruefen!!! + if( this->ISA(SbxVariable) ) + ((SbxVariable*)this)->Broadcast( SBX_HINT_DATAWANTED ); + SbxDataType t = GetType(); + if( t == SbxSTRING ) + { + if( aData.pString ) + { + XubString s( *aData.pString ); + double n; + SbxDataType t2; + USHORT nLen = 0; + if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/FALSE, bOnlyIntntl ) == SbxERR_OK ) + return BOOL( nLen == s.Len() ); + } + return FALSE; + } + else + return BOOL( t == SbxEMPTY + || ( t >= SbxINTEGER && t <= SbxCURRENCY ) + || ( t >= SbxCHAR && t <= SbxUINT ) ); +} + +SbxClassType SbxValue::GetClass() const +{ + return SbxCLASS_VALUE; +} + +SbxDataType SbxValue::GetType() const +{ + return SbxDataType( aData.eType & 0x0FFF ); +} + +SbxDataType SbxValue::GetFullType() const +{ + return aData.eType; +} + +BOOL SbxValue::SetType( SbxDataType t ) +{ + DBG_ASSERT( !( t & 0xF000 ), "Setzen von BYREF|ARRAY verboten!" ); + if( ( t == SbxEMPTY && aData.eType == SbxVOID ) + || ( aData.eType == SbxEMPTY && t == SbxVOID ) ) + return TRUE; + if( ( t & 0x0FFF ) == SbxVARIANT ) + { + // Versuch, den Datentyp auf Variant zu setzen + ResetFlag( SBX_FIXED ); + if( IsFixed() ) + { + SetError( SbxERR_CONVERSION ); return FALSE; + } + t = SbxEMPTY; + } + if( ( t & 0x0FFF ) != ( aData.eType & 0x0FFF ) ) + { + if( !CanWrite() || IsFixed() ) + { + SetError( SbxERR_CONVERSION ); return FALSE; + } + else + { + // Eventuelle Objekte freigeben + switch( aData.eType ) + { + case SbxSTRING: + delete aData.pString; + break; + case SbxOBJECT: + if( aData.pObj && aData.pObj != this ) + { + HACK(nicht bei Parent-Prop - sonst CyclicRef) + SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); + UINT16 nSlotId = pThisVar + ? ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ) + : 0; + DBG_ASSERT( nSlotId != 5345 || pThisVar->GetName() == UniString::CreateFromAscii( "Parent" ), + "SID_PARENTOBJECT heisst nicht 'Parent'" ); + BOOL bParentProp = 5345 == nSlotId; + if ( !bParentProp ) + aData.pObj->ReleaseRef(); + } + break; + default: break; + } + // Das klappt immer, da auch die Float-Repraesentationen 0 sind. + memset( &aData, 0, sizeof( SbxValues ) ); + aData.eType = t; + } + } + return TRUE; +} + +BOOL SbxValue::Convert( SbxDataType eTo ) +{ + eTo = SbxDataType( eTo & 0x0FFF ); + if( ( aData.eType & 0x0FFF ) == eTo ) + return TRUE; + if( !CanWrite() ) + return FALSE; + if( eTo == SbxVARIANT ) + { + // Versuch, den Datentyp auf Variant zu setzen + ResetFlag( SBX_FIXED ); + if( IsFixed() ) + { + SetError( SbxERR_CONVERSION ); return FALSE; + } + else + return TRUE; + } + // Convert from Null geht niemals. Einmal Null, immer Null! + if( aData.eType == SbxNULL ) + { + SetError( SbxERR_CONVERSION ); return FALSE; + } + + // Konversion der Daten: + SbxValues aNew; + aNew.eType = eTo; + if( Get( aNew ) ) + { + // Der Datentyp konnte konvertiert werden. Bei Fixed-Elementen + // ist hier Ende, da die Daten nicht uebernommen zu werden brauchen + if( !IsFixed() ) + { + SetType( eTo ); + Put( aNew ); + SetModified( TRUE ); + } + Broadcast( SBX_HINT_CONVERTED ); + return TRUE; + } + else + return FALSE; +} +////////////////////////////////// Rechnen ///////////////////////////////// + +BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) +{ + SbxDataType eThisType = GetType(); + SbxDataType eOpType = rOp.GetType(); + SbxError eOld = GetError(); + if( eOld != SbxERR_OK ) + ResetError(); + if( !CanWrite() ) + SetError( SbxERR_PROP_READONLY ); + else if( !rOp.CanRead() ) + SetError( SbxERR_PROP_WRITEONLY ); + // Sonderregel 1: Ist ein Operand Null, ist das Ergebnis Null + else if( eThisType == SbxNULL || eOpType == SbxNULL ) + SetType( SbxNULL ); + // Sonderregel 2: Ist ein Operand Empty, ist das Ergebnis der 2. Operand + else if( eThisType == SbxEMPTY ) + *this = rOp; + // 13.2.96: Nicht schon vor Get auf SbxEMPTY pruefen + else + { + SbxValues aL, aR; + bool bDecimal = false; + if( eThisType == SbxSTRING || eOp == SbxCAT ) + { + if( eOp == SbxCAT || eOp == SbxPLUS ) + { + // AB 5.11.1999, OUString beruecksichtigen + aL.eType = aR.eType = SbxSTRING; + rOp.Get( aR ); + // AB 8.12.1999, #70399: Hier wieder GetType() rufen, Get() kann Typ aendern! + if( rOp.GetType() == SbxEMPTY ) + goto Lbl_OpIsEmpty; + Get( aL ); + + // #30576: Erstmal testen, ob Wandlung geklappt hat + if( aL.pString != NULL && aR.pString != NULL ) + { + *aL.pString += *aR.pString; + } + // Nicht einmal Left OK? + else if( aL.pString == NULL ) + { + aL.pString = new String(); + } + Put( aL ); + } + else + SetError( SbxERR_CONVERSION ); + } + else if( eOpType == SbxSTRING && rOp.IsFixed() ) + { // Numerisch: rechts darf kein String stehen + SetError( SbxERR_CONVERSION ); + } + else if( ( eOp >= SbxIDIV && eOp <= SbxNOT ) || eOp == SbxMOD ) + { + if( GetType() == eOpType ) + { + if( GetType() == SbxULONG64 + || GetType() == SbxLONG64 + || GetType() == SbxCURRENCY + || GetType() == SbxULONG ) + aL.eType = aR.eType = GetType(); + else + aL.eType = aR.eType = SbxLONG; + } + else if( GetType() == SbxCURRENCY || eOpType == SbxCURRENCY + || GetType() == SbxULONG64 || eOpType == SbxULONG64 + || GetType() == SbxLONG64 || eOpType == SbxLONG64 ) + aL.eType = aR.eType = SbxLONG64; + else + aL.eType = aR.eType = SbxLONG; + + if( rOp.Get( aR ) ) + { + if( rOp.GetType() == SbxEMPTY ) + goto Lbl_OpIsEmpty; + if( Get( aL ) ) switch( eOp ) + { + case SbxIDIV: + if( aL.eType == SbxCURRENCY ) + aL.eType = SbxLONG64; + if( aL.eType == SbxLONG64 ) + if( !aR.nLong64 ) SetError( SbxERR_ZERODIV ); + else aL.nLong64 /= aR.nLong64; + else if( aL.eType == SbxULONG64 ) + if( !aR.nULong64 ) SetError( SbxERR_ZERODIV ); + else aL.nULong64 /= aR.nULong64; + else if( aL.eType == SbxLONG ) + if( !aR.nLong ) SetError( SbxERR_ZERODIV ); + else aL.nLong /= aR.nLong; + else + if( !aR.nULong ) SetError( SbxERR_ZERODIV ); + else aL.nULong /= aR.nULong; + break; + case SbxMOD: + if( aL.eType == SbxCURRENCY ) + aL.eType = SbxLONG64; + if( aL.eType == SbxLONG64 ) + if( !aR.nLong64 ) SetError( SbxERR_ZERODIV ); + else aL.nLong64 %= aR.nLong64; + else if( aL.eType == SbxULONG64 ) + if( !aR.nULong64 ) SetError( SbxERR_ZERODIV ); + else aL.nULong64 %= aR.nULong64; + else if( aL.eType == SbxLONG ) + if( !aR.nLong ) SetError( SbxERR_ZERODIV ); + else aL.nLong %= aR.nLong; + else + if( !aR.nULong ) SetError( SbxERR_ZERODIV ); + else aL.nULong %= aR.nULong; + break; + case SbxAND: + if( aL.eType != SbxLONG && aL.eType != SbxULONG ) + aL.nLong64 &= aR.nLong64; + else + aL.nLong &= aR.nLong; + break; + case SbxOR: + if( aL.eType != SbxLONG && aL.eType != SbxULONG ) + aL.nLong64 |= aR.nLong64; + else + aL.nLong |= aR.nLong; + break; + case SbxXOR: + if( aL.eType != SbxLONG && aL.eType != SbxULONG ) + aL.nLong64 ^= aR.nLong64; + else + aL.nLong ^= aR.nLong; + break; + case SbxEQV: + if( aL.eType != SbxLONG && aL.eType != SbxULONG ) + aL.nLong64 = (aL.nLong64 & aR.nLong64) | (~aL.nLong64 & ~aR.nLong64); + else + aL.nLong = (aL.nLong & aR.nLong) | (~aL.nLong & ~aR.nLong); + break; + case SbxIMP: + if( aL.eType != SbxLONG && aL.eType != SbxULONG ) + aL.nLong64 = ~aL.nLong64 | aR.nLong64; + else + aL.nLong = ~aL.nLong | aR.nLong; + break; + case SbxNOT: + if( aL.eType != SbxLONG && aL.eType != SbxULONG ) + aL.nLong64 = ~aL.nLong64; + else + aL.nLong = ~aL.nLong; + break; + default: break; + } + } + } + else if( ( GetType() == SbxDECIMAL || rOp.GetType() == SbxDECIMAL ) && + ( eOp == SbxMUL || eOp == SbxDIV || eOp == SbxPLUS || eOp == SbxMINUS || eOp == SbxNEG ) ) + { + aL.eType = aR.eType = SbxDECIMAL; + bDecimal = true; + if( rOp.Get( aR ) ) + { + if( rOp.GetType() == SbxEMPTY ) + { + releaseDecimalPtr( aL.pDecimal ); + goto Lbl_OpIsEmpty; + } + if( Get( aL ) ) + { + if( aL.pDecimal && aR.pDecimal ) + { + bool bOk = true; + switch( eOp ) + { + case SbxMUL: + bOk = ( *(aL.pDecimal) *= *(aR.pDecimal) ); + break; + case SbxDIV: + if( aR.pDecimal->isZero() ) + SetError( SbxERR_ZERODIV ); + else + bOk = ( *(aL.pDecimal) /= *(aR.pDecimal) ); + break; + case SbxPLUS: + bOk = ( *(aL.pDecimal) += *(aR.pDecimal) ); + break; + case SbxMINUS: + bOk = ( *(aL.pDecimal) -= *(aR.pDecimal) ); + break; + case SbxNEG: + bOk = ( aL.pDecimal->neg() ); + break; + default: + SetError( SbxERR_NOTIMP ); + } + if( !bOk ) + SetError( SbxERR_OVERFLOW ); + } + else + { + SetError( SbxERR_CONVERSION ); + } + } + } + } + else if( GetType() == SbxCURRENCY || rOp.GetType() == SbxCURRENCY ) + { + aL.eType = SbxCURRENCY; + aR.eType = SbxCURRENCY; + + if( rOp.Get( aR ) ) + { + static BigInt n10K( 10000 ); + + if( rOp.GetType() == SbxEMPTY ) + goto Lbl_OpIsEmpty; + + if( Get( aL ) ) switch( eOp ) + { + case SbxMUL: + { + // #i20704 Implement directly + BigInt b1( SbxINT64Converter::SbxINT64_2_BigInt( aL.nLong64 ) ); + BigInt b2( SbxINT64Converter::SbxINT64_2_BigInt( aR.nLong64 ) ); + b1 *= b2; + b1 /= n10K; + double d = double( b1 ) / 10000.0; + if( d > SbxMAXCURR || d < SbxMINCURR ) + SetError( SbxERR_OVERFLOW ); + else + SbxINT64Converter::BigInt_2_SbxINT64( b1, &aL.nLong64 ); + break; + } + case SbxDIV: + if( !aR.nLong64 ) + { + SetError( SbxERR_ZERODIV ); + } + else + { + // #i20704 Implement directly + BigInt b1( SbxINT64Converter::SbxINT64_2_BigInt( aL.nLong64 ) ); + BigInt b2( SbxINT64Converter::SbxINT64_2_BigInt( aR.nLong64 ) ); + b1 *= n10K; + b1 /= b2; + double d = double( b1 ) / 10000.0; + if( d > SbxMAXCURR || d < SbxMINCURR ) + SetError( SbxERR_OVERFLOW ); + else + SbxINT64Converter::BigInt_2_SbxINT64( b1, &aL.nLong64 ); + } + break; + case SbxPLUS: + aL.nLong64 += aR.nLong64; break; + case SbxMINUS: + aL.nLong64 -= aR.nLong64; break; + case SbxNEG: + aL.nLong64 = -aL.nLong64; break; + default: + SetError( SbxERR_NOTIMP ); + } + } + } + else + { // Andere Operatoren + aL.eType = aR.eType = SbxDOUBLE; + if( rOp.Get( aR ) ) + { + if( rOp.GetType() == SbxEMPTY ) + goto Lbl_OpIsEmpty; + if( Get( aL ) ) + { + switch( eOp ) + { + case SbxEXP: + aL.nDouble = pow( aL.nDouble, aR.nDouble ); + break; + case SbxMUL: + aL.nDouble *= aR.nDouble; break; + case SbxDIV: + if( !aR.nDouble ) SetError( SbxERR_ZERODIV ); + else aL.nDouble /= aR.nDouble; break; + case SbxPLUS: + aL.nDouble += aR.nDouble; break; + case SbxMINUS: + aL.nDouble -= aR.nDouble; break; + case SbxNEG: + aL.nDouble = -aL.nDouble; break; + default: + SetError( SbxERR_NOTIMP ); + } + + // #45465 Date braucht bei + eine Spezial-Behandlung + if( eOp == SbxPLUS && (GetType() == SbxDATE || rOp.GetType() == SbxDATE ) ) + aL.eType = SbxDATE; + } + } + + } + if( !IsError() ) + Put( aL ); + if( bDecimal ) + { + releaseDecimalPtr( aL.pDecimal ); + releaseDecimalPtr( aR.pDecimal ); + } + } +Lbl_OpIsEmpty: + + BOOL bRes = BOOL( !IsError() ); + if( bRes && eOld != SbxERR_OK ) + SetError( eOld ); + return bRes; +} + +// Die Vergleichs-Routine liefert TRUE oder FALSE. + +BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const +{ + BOOL bRes = FALSE; + SbxError eOld = GetError(); + if( eOld != SbxERR_OK ) + ResetError(); + if( !CanRead() || !rOp.CanRead() ) + SetError( SbxERR_PROP_WRITEONLY ); + else if( GetType() == SbxNULL && rOp.GetType() == SbxNULL ) + bRes = TRUE; + else if( GetType() == SbxEMPTY && rOp.GetType() == SbxEMPTY ) + bRes = TRUE; + // Sonderregel 1: Ist ein Operand Null, ist das Ergebnis FALSE + else if( GetType() == SbxNULL || rOp.GetType() == SbxNULL ) + bRes = FALSE; + // Sonderregel 2: Wenn beide Variant sind und einer ist numerisch, + // und der andere ein String, ist num < str + else if( !IsFixed() && !rOp.IsFixed() + && ( rOp.GetType() == SbxSTRING && GetType() != SbxSTRING && IsNumeric() ) ) + bRes = BOOL( eOp == SbxLT || eOp == SbxLE || eOp == SbxNE ); + else if( !IsFixed() && !rOp.IsFixed() + && ( GetType() == SbxSTRING && rOp.GetType() != SbxSTRING && rOp.IsNumeric() ) ) + bRes = BOOL( eOp == SbxGT || eOp == SbxGE || eOp == SbxNE ); + else + { + SbxValues aL, aR; + // Wenn einer der Operanden ein String ist, + // findet ein Stringvergleich statt + if( GetType() == SbxSTRING || rOp.GetType() == SbxSTRING ) + { + aL.eType = aR.eType = SbxSTRING; + if( Get( aL ) && rOp.Get( aR ) ) switch( eOp ) + { + case SbxEQ: + bRes = BOOL( *aL.pString == *aR.pString ); break; + case SbxNE: + bRes = BOOL( *aL.pString != *aR.pString ); break; + case SbxLT: + bRes = BOOL( *aL.pString < *aR.pString ); break; + case SbxGT: + bRes = BOOL( *aL.pString > *aR.pString ); break; + case SbxLE: + bRes = BOOL( *aL.pString <= *aR.pString ); break; + case SbxGE: + bRes = BOOL( *aL.pString >= *aR.pString ); break; + default: + SetError( SbxERR_NOTIMP ); + } + } + // Wenn SbxSINGLE beteiligt, auf SINGLE konvertieren, + // sonst gibt es numerische Fehler + else if( GetType() == SbxSINGLE || rOp.GetType() == SbxSINGLE ) + { + aL.eType = aR.eType = SbxSINGLE; + if( Get( aL ) && rOp.Get( aR ) ) + switch( eOp ) + { + case SbxEQ: + bRes = BOOL( aL.nSingle == aR.nSingle ); break; + case SbxNE: + bRes = BOOL( aL.nSingle != aR.nSingle ); break; + case SbxLT: + bRes = BOOL( aL.nSingle < aR.nSingle ); break; + case SbxGT: + bRes = BOOL( aL.nSingle > aR.nSingle ); break; + case SbxLE: + bRes = BOOL( aL.nSingle <= aR.nSingle ); break; + case SbxGE: + bRes = BOOL( aL.nSingle >= aR.nSingle ); break; + default: + SetError( SbxERR_NOTIMP ); + } + } + else if( GetType() == SbxDECIMAL && rOp.GetType() == SbxDECIMAL ) + { + aL.eType = aR.eType = SbxDECIMAL; + Get( aL ); + rOp.Get( aR ); + if( aL.pDecimal && aR.pDecimal ) + { + SbxDecimal::CmpResult eRes = compare( *aL.pDecimal, *aR.pDecimal ); + switch( eOp ) + { + case SbxEQ: + bRes = BOOL( eRes == SbxDecimal::EQ ); break; + case SbxNE: + bRes = BOOL( eRes != SbxDecimal::EQ ); break; + case SbxLT: + bRes = BOOL( eRes == SbxDecimal::LT ); break; + case SbxGT: + bRes = BOOL( eRes == SbxDecimal::GT ); break; + case SbxLE: + bRes = BOOL( eRes != SbxDecimal::GT ); break; + case SbxGE: + bRes = BOOL( eRes != SbxDecimal::LT ); break; + default: + SetError( SbxERR_NOTIMP ); + } + } + else + { + SetError( SbxERR_CONVERSION ); + } + releaseDecimalPtr( aL.pDecimal ); + releaseDecimalPtr( aR.pDecimal ); + } + // Alles andere auf SbxDOUBLE-Basis vergleichen + else + { + aL.eType = aR.eType = SbxDOUBLE; + if( Get( aL ) && rOp.Get( aR ) ) + switch( eOp ) + { + case SbxEQ: + bRes = BOOL( aL.nDouble == aR.nDouble ); break; + case SbxNE: + bRes = BOOL( aL.nDouble != aR.nDouble ); break; + case SbxLT: + bRes = BOOL( aL.nDouble < aR.nDouble ); break; + case SbxGT: + bRes = BOOL( aL.nDouble > aR.nDouble ); break; + case SbxLE: + bRes = BOOL( aL.nDouble <= aR.nDouble ); break; + case SbxGE: + bRes = BOOL( aL.nDouble >= aR.nDouble ); break; + default: + SetError( SbxERR_NOTIMP ); + } + } + } + if( eOld != SbxERR_OK ) + SetError( eOld ); + return bRes; +} + +///////////////////////////// Lesen/Schreiben //////////////////////////// + +BOOL SbxValue::LoadData( SvStream& r, USHORT ) +{ + SbxValue::Clear(); + UINT16 nType; + r >> nType; + aData.eType = SbxDataType( nType ); + switch( nType ) + { + case SbxBOOL: + case SbxINTEGER: + r >> aData.nInteger; break; + case SbxLONG: + r >> aData.nLong; break; + case SbxSINGLE: + { + // Floats als ASCII + XubString aVal; + r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + double d; + SbxDataType t; + if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) + { + aData.nSingle = 0.0F; + return FALSE; + } + aData.nSingle = (float) d; + break; + } + case SbxDATE: + case SbxDOUBLE: + { + // Floats als ASCII + XubString aVal; + r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + SbxDataType t; + if( ImpScan( aVal, aData.nDouble, t, NULL ) != SbxERR_OK ) + { + aData.nDouble = 0.0; + return FALSE; + } + break; + } + case SbxULONG64: + { + r >> aData.nULong64.nHigh >> aData.nULong64.nLow; + break; + } + case SbxLONG64: + case SbxCURRENCY: + { + r >> aData.nLong64.nHigh >> aData.nLong64.nLow; + break; + } + case SbxSTRING: + { + XubString aVal; + r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + if( aVal.Len() ) + aData.pString = new XubString( aVal ); + else + aData.pString = NULL; + break; + } + case SbxERROR: + case SbxUSHORT: + r >> aData.nUShort; break; + case SbxOBJECT: + { + BYTE nMode; + r >> nMode; + switch( nMode ) + { + case 0: + aData.pObj = NULL; + break; + case 1: + aData.pObj = SbxBase::Load( r ); + return BOOL( aData.pObj != NULL ); + case 2: + aData.pObj = this; + break; + } + break; + } + case SbxCHAR: + { + char c; + r >> c; + aData.nChar = c; + break; + } + case SbxBYTE: + r >> aData.nByte; break; + case SbxULONG: + r >> aData.nULong; break; + case SbxINT: + { + BYTE n; + r >> n; + // Passt der Int auf diesem System? + if( n > SAL_TYPES_SIZEOFINT ) + r >> aData.nLong, aData.eType = SbxLONG; + else + r >> aData.nInt; + break; + } + case SbxUINT: + { + BYTE n; + r >> n; + // Passt der UInt auf diesem System? + if( n > SAL_TYPES_SIZEOFINT ) + r >> aData.nULong, aData.eType = SbxULONG; + else + r >> (sal_uInt32&)aData.nUInt; + break; + } + case SbxEMPTY: + case SbxNULL: + case SbxVOID: + break; + case SbxDATAOBJECT: + r >> aData.nLong; + break; + // #78919 For backwards compatibility + case SbxWSTRING: + case SbxWCHAR: + break; + default: + memset (&aData,0,sizeof(aData)); + ResetFlag(SBX_FIXED); + aData.eType = SbxNULL; + DBG_ASSERT( !this, "Nicht unterstuetzer Datentyp geladen" ); + return FALSE; + } + return TRUE; +} + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/source/sbx/sbxvar.cxx b/bf_basic/source/sbx/sbxvar.cxx new file mode 100644 index 00000000000..a8526d10236 --- /dev/null +++ b/bf_basic/source/sbx/sbxvar.cxx @@ -0,0 +1,495 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#include +#include "bf_svtools/brdcst.hxx" + +#include "sbx.hxx" +#include "sbxres.hxx" +#include "sbxconv.hxx" +#include +#include + +namespace binfilter { + +///////////////////////////// SbxVariable ////////////////////////////// + +TYPEINIT1(SbxVariable,SbxValue) +TYPEINIT1(SbxHint,SfxSimpleHint) + +extern UINT32 nVarCreator; // in SBXBASE.CXX, fuer LoadData() + +///////////////////////////// Konstruktoren ////////////////////////////// + +SbxVariable::SbxVariable() : SbxValue() +{ + pCst = NULL; + pParent = NULL; + nUserData = 0; + nHash = 0; +} + +SbxVariable::SbxVariable( const SbxVariable& r ) + : SvRefBase( r ), SbxValue( r ), mpPar( r.mpPar ), pInfo( r.pInfo ) +{ + pCst = NULL; + if( r.CanRead() ) + { + pParent = r.pParent; + nUserData = r.nUserData; + maName = r.maName; + nHash = r.nHash; + } + else + { + pParent = NULL; + nUserData = 0; + nHash = 0; + } +} + +SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p ) +{ + pCst = NULL; + pParent = NULL; + nUserData = 0; + nHash = 0; +} + +SbxVariable::~SbxVariable() +{ + delete pCst; +} + +////////////////////////////// Broadcasting ////////////////////////////// + +SfxBroadcaster& SbxVariable::GetBroadcaster() +{ + if( !pCst ) + pCst = new SfxBroadcaster; + return *pCst; +} + +// Eines Tages kann man vielleicht den Parameter 0 schleifen, +// dann entfaellt die Kopiererei... + +void SbxVariable::Broadcast( ULONG nHintId ) +{ + if( pCst && !IsSet( SBX_NO_BROADCAST ) && StaticIsEnabledBroadcasting() ) + { + // Da die Methode von aussen aufrufbar ist, hier noch einmal + // die Berechtigung testen + if( nHintId & SBX_HINT_DATAWANTED ) + if( !CanRead() ) + return; + if( nHintId & SBX_HINT_DATACHANGED ) + if( !CanWrite() ) + return; + // Weitere Broadcasts verhindern + SfxBroadcaster* pSave = pCst; + pCst = NULL; + USHORT nSaveFlags = GetFlags(); + SetFlag( SBX_READWRITE ); + if( mpPar.Is() ) + // this, als Element 0 eintragen, aber den Parent nicht umsetzen! + mpPar->GetRef( 0 ) = this; + pSave->Broadcast( SbxHint( nHintId, this ) ); + delete pCst; // wer weiss schon, auf welche Gedanken mancher kommt? + pCst = pSave; + SetFlags( nSaveFlags ); + } +} + +SbxInfo* SbxVariable::GetInfo() +{ + if( !pInfo ) + { + Broadcast( SBX_HINT_INFOWANTED ); + if( pInfo.Is() ) + SetModified( TRUE ); + } + return pInfo; +} + +void SbxVariable::SetParameters( SbxArray* p ) +{ + mpPar = p; +} + + +/////////////////////////// Name der Variablen /////////////////////////// + +void SbxVariable::SetName( const XubString& rName ) +{ + maName = rName; + nHash = MakeHashCode( rName ); +} + +const XubString& SbxVariable::GetName( SbxNameType t ) const +{ + static char cSuffixes[] = " %&!#@ $"; + if( t == SbxNAME_NONE ) + return maName; + // Parameter-Infos anfordern (nicht fuer Objekte) + ((SbxVariable*)this)->GetInfo(); + // Nix anfuegen, wenn einfache Property (keine leeren Klammern) + if( !pInfo + || ( !pInfo->aParams.Count() && GetClass() == SbxCLASS_PROPERTY ) ) + return maName; + xub_Unicode cType = ' '; + XubString aTmp( maName ); + // Kurzer Typ? Dann holen, evtl. ist dieser 0. + SbxDataType et = GetType(); + if( t == SbxNAME_SHORT_TYPES ) + { + if( et <= SbxSTRING ) + cType = cSuffixes[ et ]; + if( cType != ' ' ) + aTmp += cType; + } + aTmp += '('; + for( USHORT i = 0; i < pInfo->aParams.Count(); i++ ) + { + const SbxParamInfo* q = pInfo->aParams.GetObject( i ); + int nt = q->eType & 0x0FFF; + if( i ) + aTmp += ','; + if( q->nFlags & SBX_OPTIONAL ) + aTmp += SbxRes( STRING_OPTIONAL ); + if( q->eType & SbxBYREF ) + aTmp += SbxRes( STRING_BYREF ); + aTmp += q->aName; + cType = ' '; + // Kurzer Typ? Dann holen, evtl. ist dieser 0. + if( t == SbxNAME_SHORT_TYPES ) + { + if( nt <= SbxSTRING ) + cType = cSuffixes[ nt ]; + } + if( cType != ' ' ) + { + aTmp += cType; + if( q->eType & SbxARRAY ) + aTmp.AppendAscii( "()" ); + } + else + { + if( q->eType & SbxARRAY ) + aTmp.AppendAscii( "()" ); + // langer Typ? + if( t != SbxNAME_SHORT ) + { + aTmp += SbxRes( STRING_AS ); + if( nt < 32 ) + aTmp += SbxRes( + sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ); + else + aTmp += SbxRes( STRING_ANY ); + } + } + } + aTmp += ')'; + // Langer Typ? Dann holen + if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY ) + { + aTmp += SbxRes( STRING_AS ); + if( et < 32 ) + aTmp += SbxRes( + sal::static_int_cast< USHORT >( STRING_TYPES + et ) ); + else + aTmp += SbxRes( STRING_ANY ); + } + ((SbxVariable*) this)->aPic = aTmp; + return aPic; +} + +// Einen simplen Hashcode erzeugen: Es werden die ersten 6 Zeichen gewertet. + +USHORT SbxVariable::MakeHashCode( const XubString& rName ) +{ + USHORT n = 0; + USHORT nLen = rName.Len(); + if( nLen > 6 ) + nLen = 6; + const xub_Unicode* p = rName.GetBuffer(); + while( nLen-- ) + { + BYTE c = (BYTE)*p; + p++; + // Falls wir ein Schweinezeichen haben, abbrechen!! + if( c >= 0x80 ) + return 0; + n = sal::static_int_cast< USHORT >( ( n << 3 ) + toupper( c ) ); + } + return n; +} + +////////////////////////////// Operatoren //////////////////////////////// + +SbxVariable& SbxVariable::operator=( const SbxVariable& r ) +{ + SbxValue::operator=( r ); + return *this; +} + +//////////////////////////////// Konversion //////////////////////////////// + +SbxDataType SbxVariable::GetType() const +{ + if( aData.eType == SbxOBJECT ) + return aData.pObj ? aData.pObj->GetType() : SbxOBJECT; + else if( aData.eType == SbxVARIANT ) + return aData.pObj ? aData.pObj->GetType() : SbxVARIANT; + else + return aData.eType; +} + +SbxClassType SbxVariable::GetClass() const +{ + return SbxCLASS_VARIABLE; +} + +void SbxVariable::SetModified( BOOL b ) +{ + if( IsSet( SBX_NO_MODIFY ) ) + return; + SbxBase::SetModified( b ); + if( pParent && pParent != this ) //??? HotFix: Rekursion raus MM + pParent->SetModified( b ); +} + +void SbxVariable::SetParent( SbxObject* p ) +{ +#ifdef DBG_UTIL + // wird der Parent eines SbxObjects gesetzt? + if ( p && ISA(SbxObject) ) + { + // dann mu\s dieses auch Child vom neuen Parent sein + BOOL bFound = FALSE; + SbxArray *pChilds = p->GetObjects(); + if ( pChilds ) + { + for ( USHORT nIdx = 0; !bFound && nIdx < pChilds->Count(); ++nIdx ) + bFound = ( this == pChilds->Get(nIdx) ); + } + if ( !bFound ) + { + String aMsg = String::CreateFromAscii( "dangling: [" ); + aMsg += GetName(); + aMsg.AppendAscii( "].SetParent([" ); + aMsg += p->GetName(); + aMsg.AppendAscii( "])" ); + rtl::OString aBStr(rtl::OUStringToOString(aMsg, RTL_TEXTENCODING_ASCII_US)); + DbgOut( aBStr.getStr(), DBG_OUT_WARNING, __FILE__, __LINE__); + } + } +#endif + + pParent = p; +} + +////////////////////////////// Laden/Speichern ///////////////////////////// + +BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) +{ + UINT16 nType; + BYTE cMark; + rStrm >> cMark; + if( cMark == 0xFF ) + { + if( !SbxValue::LoadData( rStrm, nVer ) ) + return FALSE; + rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US ); + rStrm >> nUserData; + } + else + { + rStrm.SeekRel( -1L ); + rStrm >> nType; + rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US ); + rStrm >> nUserData; + // Korrektur: Alte Methoden haben statt SbxNULL jetzt SbxEMPTY + if( nType == SbxNULL && GetClass() == SbxCLASS_METHOD ) + nType = SbxEMPTY; + SbxValues aTmp; + XubString aVal; + aTmp.eType = aData.eType = (SbxDataType) nType; + aTmp.pString = &aVal; + switch( nType ) + { + case SbxBOOL: + case SbxERROR: + case SbxINTEGER: + rStrm >> aTmp.nInteger; break; + case SbxLONG: + rStrm >> aTmp.nLong; break; + case SbxSINGLE: + { + // Floats als ASCII + rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + double d; + SbxDataType t; + if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) + { + aTmp.nSingle = 0; + return FALSE; + } + aTmp.nSingle = (float) d; + break; + } + case SbxDATE: + case SbxDOUBLE: + { + // Floats als ASCII + rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + SbxDataType t; + if( ImpScan( aVal, aTmp.nDouble, t, NULL ) != SbxERR_OK ) + { + aTmp.nDouble = 0; + return FALSE; + } + break; + } + case SbxSTRING: + rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + break; + case SbxEMPTY: + case SbxNULL: + break; + default: + aData.eType = SbxNULL; + DBG_ASSERT( !this, "Nicht unterstuetzer Datentyp geladen" ); + return FALSE; + } + // Wert putten + if( nType != SbxNULL && nType != SbxEMPTY && !Put( aTmp ) ) + return FALSE; + } + rStrm >> cMark; + // cMark ist auch eine Versionsnummer! + // 1: initial version + // 2: mit nUserData + if( cMark ) + { + if( cMark > 2 ) + return FALSE; + pInfo = new SbxInfo; + pInfo->LoadData( rStrm, (USHORT) cMark ); + } + // Privatdaten nur laden, wenn es eine SbxVariable ist + if( GetClass() == SbxCLASS_VARIABLE && !LoadPrivateData( rStrm, nVer ) ) + return FALSE; + ((SbxVariable*) this)->Broadcast( SBX_HINT_DATACHANGED ); + nHash = MakeHashCode( maName ); + SetModified( TRUE ); + return TRUE; +} + + +SbxInfo::SbxInfo() : aHelpFile(), nHelpId( 0 ), aParams() +{} + +////////////////////////////// SbxAlias ////////////////////////////////// + +SbxAlias::SbxAlias( const SbxAlias& r ) + : SvRefBase( r ), SbxVariable( r ), + SfxListener( r ), xAlias( r.xAlias ) +{} + +SbxAlias& SbxAlias::operator=( const SbxAlias& r ) +{ + xAlias = r.xAlias; + return *this; +} + +SbxAlias::~SbxAlias() +{ + if( xAlias.Is() ) + EndListening( xAlias->GetBroadcaster() ); +} + +void SbxAlias::Broadcast( ULONG nHt ) +{ + if( xAlias.Is() && StaticIsEnabledBroadcasting() ) + { + xAlias->SetParameters( GetParameters() ); + if( nHt == SBX_HINT_DATAWANTED ) + SbxVariable::operator=( *xAlias ); + else if( nHt == SBX_HINT_DATACHANGED || nHt == SBX_HINT_CONVERTED ) + *xAlias = *this; + else if( nHt == SBX_HINT_INFOWANTED ) + { + xAlias->Broadcast( nHt ); + pInfo = xAlias->GetInfo(); + } + } +} + +void SbxAlias::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, + const SfxHint& rHint, const TypeId& ) +{ + const SbxHint* p = PTR_CAST(SbxHint,&rHint); + if( p && p->GetId() == SBX_HINT_DYING ) + { + xAlias.Clear(); + // Alias loeschen? + if( pParent ) + pParent->Remove( this ); + } +} + +void SbxVariable::Dump( SvStream& rStrm, BOOL bFill ) +{ + rtl::OString aBNameStr(rtl::OUStringToOString(GetName( SbxNAME_SHORT_TYPES ), RTL_TEXTENCODING_ASCII_US)); + rStrm << "Variable( " + << rtl::OString::valueOf(reinterpret_cast(this)).getStr() << "==" + << aBNameStr.getStr(); + rtl::OString aBParentNameStr(rtl::OUStringToOString(GetParent()->GetName(), RTL_TEXTENCODING_ASCII_US)); + if ( GetParent() ) + rStrm << " in parent '" << aBParentNameStr.getStr() << "'"; + else + rStrm << " no parent"; + rStrm << " ) "; + + // bei Object-Vars auch das Object ausgeben + if ( GetValues_Impl().eType == SbxOBJECT && + GetValues_Impl().pObj && + GetValues_Impl().pObj != this && + GetValues_Impl().pObj != GetParent() ) + { + rStrm << " contains "; + ((SbxObject*) GetValues_Impl().pObj)->Dump( rStrm, bFill ); + } + else + rStrm << endl; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_basic/util/makefile.mk b/bf_basic/util/makefile.mk new file mode 100644 index 00000000000..5c20d63dcd2 --- /dev/null +++ b/bf_basic/util/makefile.mk @@ -0,0 +1,88 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +BFPRJ=.. +PRJ=..$/.. + +PRJNAME=binfilter +TARGET=bf_sb + +# --- Settings --------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Allgemein --------------------------------------------------- + +LIB1TARGET=$(SLB)$/$(TARGET).lib +LIB1FILES= \ + $(SLB)$/basic_basicmgr.lib \ + $(SLB)$/basic_sbx.lib \ + $(SLB)$/basic_classes.lib \ + $(SLB)$/basic_comp.lib \ + $(SLB)$/basic_runtime.lib + +SHL1TARGET=$(TARGET)$(DLLPOSTFIX) +SHL1IMPLIB=$(TARGET) + +SHL1STDLIBS= \ + $(TOOLSLIB) \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(BFSVTOOLLIB) \ + $(SALLIB) \ + $(COMPHELPERLIB) \ + $(UNOTOOLSLIB) \ + $(SOTLIB) \ + $(VCLLIB) + +.IF "$(GUI)"=="WNT" +SHL1STDLIBS+= \ + $(UWINAPILIB) \ + $(OLEAUT32LIB) +.ENDIF # WNT + +SHL1DEF= $(MISC)$/$(SHL1TARGET).def +SHL1LIBS= $(SLB)$/$(TARGET).lib + +DEF1NAME =$(SHL1TARGET) +DEF1DEPN = \ + $(MISC)$/$(SHL1TARGET).flt + +DEFLIB1NAME =$(TARGET) + +# --- Targets ----------------------------------------------------------- + +.INCLUDE : target.mk + +# --- Basic-Filter-Datei --- + +$(MISC)$/$(SHL1TARGET).flt: makefile.mk + @echo ------------------------------ + @echo Making: $@ + @echo __CT >> $@ + + diff --git a/bf_forms/source/component/BaseListBox.hxx b/bf_forms/source/component/BaseListBox.hxx new file mode 100644 index 00000000000..3f9834a6e0b --- /dev/null +++ b/bf_forms/source/component/BaseListBox.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_BASELISTBOX_HXX_ +#define _FORMS_BASELISTBOX_HXX_ + +namespace binfilter { +//......................................................................... +namespace frm +{ + +const sal_uInt16 ENTRY_NOT_FOUND = 0xFFFF; +const sal_uInt16 BOUNDCOLUMN = 0x0001; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_BASELISTBOX_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Button.hxx b/bf_forms/source/component/Button.hxx new file mode 100644 index 00000000000..46e60a976d0 --- /dev/null +++ b/bf_forms/source/component/Button.hxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_BUTTON_HXX_ +#define _FRM_BUTTON_HXX_ + +#include "Image.hxx" + +#include +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +// OButtonModel +//================================================================== +class OButtonModel + :public OImageModel + ,public ::comphelper::OAggregationArrayUsageHelper +{ +public: + DECLARE_DEFAULT_LEAF_XTOR( OButtonModel ); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OButtonModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//================================================================== +// OButtonControl +//================================================================== +typedef ::cppu::ImplHelper2< ::com::sun::star::awt::XButton, + ::com::sun::star::awt::XActionListener> OButtonControl_BASE; +class OButtonControl : public OButtonControl_BASE, + public OImageControl +{ + sal_uInt32 nClickEvent; + +protected: + + // UNO Anbindung + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + OButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + virtual ~OButtonControl(); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OButtonControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OButtonControl, OImageControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::awt::XActionListener + virtual void SAL_CALL actionPerformed(const ::com::sun::star::awt::ActionEvent& rEvent) throw ( ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::awt::XButton + virtual void SAL_CALL addActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLabel(const ::rtl::OUString& Label) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActionCommand(const ::rtl::OUString& _rCommand) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) + { OControl::disposing(_rSource); } + + using OImageControl::disposing; + +private: + DECL_LINK( OnClick, void* ); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_BUTTON_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/CheckBox.hxx b/bf_forms/source/component/CheckBox.hxx new file mode 100644 index 00000000000..28a41732253 --- /dev/null +++ b/bf_forms/source/component/CheckBox.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_CHECKBOX_HXX_ +#define _FORMS_CHECKBOX_HXX_ + +#include "FormComponent.hxx" + +#include +namespace binfilter { + +//......................................................................... +namespace frm +{ + +enum { CB_NOCHECK, CB_CHECK, CB_DONTKNOW }; + +//================================================================== +//= OCheckBoxModel +//================================================================== +class OCheckBoxModel :public OBoundControlModel + ,public OPropertyChangeListener + ,public ::comphelper::OAggregationArrayUsageHelper< OCheckBoxModel > +{ + ::rtl::OUString m_sReferenceValue; // Referenzwert zum Checken des Buttons + sal_Int16 m_nDefaultChecked; // Soll beim Reset gecheckt werden ? + sal_Bool m_bInReset; + + OPropertyChangeMultiplexer* m_pAggregatePropertyMultiplexer; + +protected: + sal_Int16 getState(const ::com::sun::star::uno::Any& rValue); + + virtual ::com::sun::star::uno::Any _getControlValue() const; + +public: + DECLARE_DEFAULT_LEAF_XTOR( OCheckBoxModel ); + + // XServiceInfo + IMPLEMENTATION_NAME(OCheckBoxModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // OPropertySetHelper + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + + // XPropertySetRef + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // OPropertyChangeListener + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException); + + // XReset + virtual void SAL_CALL reset() throw(::com::sun::star::uno::RuntimeException); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + virtual void SAL_CALL disposing(); + using OBoundControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + +protected: + void implConstruct(); + + DECLARE_XCLONEABLE(); +}; + +//================================================================== +//= OCheckBoxControl +//================================================================== +class OCheckBoxControl : public OBoundControl +{ +public: + OCheckBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + + // XServiceInfo + IMPLEMENTATION_NAME(OCheckBoxControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_CHECKBOX_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Columns.hxx b/bf_forms/source/component/Columns.hxx new file mode 100644 index 00000000000..aadef845e7a --- /dev/null +++ b/bf_forms/source/component/Columns.hxx @@ -0,0 +1,224 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_COLUMNS_HXX +#define _FRM_COLUMNS_HXX + +#include +#include +#include "strings.hxx" + +#include +#include +#include +#include +#include "cloneable.hxx" +namespace binfilter { + + using namespace ::comphelper; + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +// OGridColumn +//================================================================== +typedef ::cppu::WeakAggComponentImplHelper2< ::com::sun::star::container::XChild, + ::com::sun::star::lang::XUnoTunnel > OGridColumn_BASE; +class OGridColumn :public ::comphelper::OBaseMutex + ,public OGridColumn_BASE + ,public OPropertySetAggregationHelper + ,public OCloneableAggregation +{ +protected: +// [properties] + ::com::sun::star::uno::Any m_aWidth; // column width + ::com::sun::star::uno::Any m_aAlign; // column alignment + ::com::sun::star::uno::Any m_aHidden; // column hidden? +// [properties] + + InterfaceRef m_xParent; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> + m_xAggregate; + ::rtl::OUString m_aModelName; + +// [properties] + ::rtl::OUString m_aLabel; // Name der Spalte +// [properties] + +public: + OGridColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sModelName = ::rtl::OUString()); + virtual ~OGridColumn(); + + // UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OGridColumn_BASE); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence& getUnoTunnelImplementationId(); + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence& _rIdentifier) throw(::com::sun::star::uno::RuntimeException); + +// XTypeProvider + virtual ::com::sun::star::uno::Sequence SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XChild + virtual InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException){return m_xParent;} + virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::io::XPersistObject + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); + +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); + + using OPropertySetAggregationHelper::getFastPropertyValue; + +// ::com::sun::star::beans::XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + + const ::rtl::OUString& getModelName() const { return m_aModelName; } + +protected: + static void clearAggregateProperties(::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property>& seqProps, sal_Bool bAllowDropDown); + static void setOwnProperties(::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property>& seqProps); + + //DECLARE_XCLONEABLE(); +}; + +#define DECL_COLUMN(ClassName) \ +class ClassName \ + :public OGridColumn \ + ,public OAggregationArrayUsageHelper< ClassName > \ +{ \ +public: \ + ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);\ + \ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); \ + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); \ + \ + virtual void fillProperties( \ + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, \ + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps \ + ) const; \ +}; + + +#define IMPL_COLUMN(ClassName, Model, bAllowDropDown) \ +ClassName::ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory) \ + :OGridColumn(_rxFactory, Model){} \ +::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> ClassName::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)\ +{ \ + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); \ + return xInfo; \ +} \ +::cppu::IPropertyArrayHelper& ClassName::getInfoHelper() \ +{ \ + return *const_cast(this)->getArrayHelper(); \ +} \ +void ClassName::fillProperties( \ + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, \ + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps \ + ) const \ +{ \ + if (m_xAggregateSet.is()) \ + { \ + _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties(); \ + clearAggregateProperties(_rAggregateProps, bAllowDropDown); \ + setOwnProperties(_rProps); \ + } \ +} \ + +// liste der moeglichen Controls +DECLARE_CONSTASCII_USTRING(FRM_COL_TEXTFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COL_CHECKBOX); +DECLARE_CONSTASCII_USTRING(FRM_COL_COMBOBOX); +DECLARE_CONSTASCII_USTRING(FRM_COL_LISTBOX); +DECLARE_CONSTASCII_USTRING(FRM_COL_NUMERICFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COL_DATEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COL_TIMEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COL_CURRENCYFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COL_PATTERNFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COL_FORMATTEDFIELD); + + +// column type ids +#define TYPE_CHECKBOX 0 +#define TYPE_COMBOBOX 1 +#define TYPE_CURRENCYFIELD 2 +#define TYPE_DATEFIELD 3 +#define TYPE_FORMATTEDFIELD 4 +#define TYPE_LISTBOX 5 +#define TYPE_NUMERICFIELD 6 +#define TYPE_PATTERNFIELD 7 +#define TYPE_TEXTFIELD 8 +#define TYPE_TIMEFIELD 9 + +// liste aller bekannten columns +const StringSequence& getColumnTypes(); +sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName); + +// Columns +DECL_COLUMN(TextFieldColumn) +DECL_COLUMN(PatternFieldColumn) +DECL_COLUMN(DateFieldColumn) +DECL_COLUMN(TimeFieldColumn) +DECL_COLUMN(NumericFieldColumn) +DECL_COLUMN(CurrencyFieldColumn) +DECL_COLUMN(CheckBoxColumn) +DECL_COLUMN(ComboBoxColumn) +DECL_COLUMN(ListBoxColumn) +DECL_COLUMN(FormattedFieldColumn) + + +} // namespace frm +}//end of namespace binfilter +#endif // _FRM_COLUMNS_HXX + +//......................................................................... + +//......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/ComboBox.hxx b/bf_forms/source/component/ComboBox.hxx new file mode 100644 index 00000000000..62f241920da --- /dev/null +++ b/bf_forms/source/component/ComboBox.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_COMBOBOX_HXX_ +#define _FORMS_COMBOBOX_HXX_ + +#include "FormComponent.hxx" + +#include +#include +#include "errorbroadcaster.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + +//================================================================== +// OComboBoxModel +//================================================================== +class OComboBoxModel + :public OBoundControlModel + ,public OErrorBroadcaster + ,public ::comphelper::OAggregationArrayUsageHelper< OComboBoxModel > +{ + ::com::sun::star::uno::Any m_aBoundColumn; // obsolet + ::rtl::OUString m_aListSource; // + ::rtl::OUString m_aDefaultText; // DefaultText + ::rtl::OUString m_aSaveValue; + + StringSequence m_aDesignModeStringItems; + // upon loading, in some cases we reset fill our string item list ourself. We don't want + // to lose the user's items then, so we remember them here. + + + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter> m_xFormatter; + + ::com::sun::star::form::ListSourceType m_eListSourceType; // type der list source + ::com::sun::star::util::Date m_aNullDate; + sal_Int32 m_nFormatKey; + sal_Int16 m_nFieldType; + sal_Int16 m_nKeyType; + sal_Bool m_bEmptyIsNull; // LeerString wird als NULL interpretiert + + + + static sal_Int32 nTextHandle; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( OComboBoxModel ); + + virtual void SAL_CALL disposing(); + + // OPropertySetHelper + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + + virtual void SAL_CALL reloaded( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + IMPLEMENTATION_NAME(OComboBoxModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // UNO + DECLARE_UNO3_AGG_DEFAULTS(OComboBoxModel, OBoundControlModel); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OBoundControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + void loadData(); + + DECLARE_XCLONEABLE(); +}; + +//================================================================== +// OComboBoxControl +//================================================================== + +class OComboBoxControl : public OBoundControl +{ +public: + OComboBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + + // XServiceInfo + IMPLEMENTATION_NAME(OComboBoxControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_COMBOBOX_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Currency.hxx b/bf_forms/source/component/Currency.hxx new file mode 100644 index 00000000000..be80d63966a --- /dev/null +++ b/bf_forms/source/component/Currency.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_CURRENCY_HXX_ +#define _FORMS_CURRENCY_HXX_ + +#include "EditBase.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +//= OCurrencyModel +//================================================================== +class OCurrencyModel + :public OEditBaseModel + ,public ::comphelper::OAggregationArrayUsageHelper< OCurrencyModel > +{ + ::com::sun::star::uno::Any m_aSaveValue; + + static sal_Int32 nValueHandle; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( OCurrencyModel ); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OCurrencyModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + + // ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun ::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); + + void implConstruct(); +}; + +//================================================================== +//= OCurrencyControl +//================================================================== +class OCurrencyControl: public OBoundControl +{ +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + OCurrencyControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OCurrencyControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_CURRENCY_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/DatabaseForm.hxx b/bf_forms/source/component/DatabaseForm.hxx new file mode 100644 index 00000000000..dd55e7bf6eb --- /dev/null +++ b/bf_forms/source/component/DatabaseForm.hxx @@ -0,0 +1,485 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_DATABASEFORM_HXX_ +#define _FRM_DATABASEFORM_HXX_ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include "InterfaceContainer.hxx" +#include "ids.hxx" + +#include +#include +#include +#include +#include + +namespace com { namespace sun { namespace star { namespace sdbc { + class SQLException; +} } } } +class Timer; +class INetMIMEMessage; +namespace binfilter { + + +//typedef ::comphelper::OReusableGuard< ::osl::Mutex > ReusableMutexGuard; + +//......................................................................... +namespace frm +{ +//......................................................................... + +//======================================================================== +//= html tools +//======================================================================== + +const sal_uInt16 SUCCESSFUL_REPRESENT_TEXT = 0x0001; +const sal_uInt16 SUCCESSFUL_REPRESENT_FILE = 0x0002; + +const ::rtl::OUString ALL_COMPONENTS_GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "AllComponentGroup" )); + +//------------------------------------------------------------------------------ +class HtmlSuccessfulObj +{ +public: + ::rtl::OUString aName; + ::rtl::OUString aValue; + sal_uInt16 nRepresentation; + + HtmlSuccessfulObj( const ::rtl::OUString& _rName, const ::rtl::OUString& _rValue, + sal_uInt16 _nRepresent = SUCCESSFUL_REPRESENT_TEXT ) + :aName( _rName ) + ,aValue( _rValue ) + ,nRepresentation( _nRepresent ) + { + } + + HtmlSuccessfulObj() + { + } +}; + + +DECLARE_STL_VECTOR(HtmlSuccessfulObj, HtmlSuccessfulObjList); + +//======================================================================== +class OGroupManager; +class OFormSubmitResetThread; +struct OParameterInfoImpl; +typedef ::cppu::ImplHelper11< ::com::sun::star::form::XForm, + ::com::sun::star::awt::XTabControllerModel, + ::com::sun::star::form::XLoadListener, + ::com::sun::star::sdbc::XRowSetListener, + ::com::sun::star::sdb::XRowSetApproveListener, + ::com::sun::star::form::XDatabaseParameterBroadcaster, + ::com::sun::star::sdb::XSQLErrorListener, + ::com::sun::star::sdb::XSQLErrorBroadcaster, + ::com::sun::star::form::XReset, + ::com::sun::star::form::XSubmit, + ::com::sun::star::form::XLoadable > ODatabaseForm_BASE1; + + +typedef ::cppu::ImplHelper2< ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XServiceInfo> ODatabaseForm_BASE2; + +typedef ::cppu::ImplHelper7< ::com::sun::star::sdbc::XCloseable, + ::com::sun::star::sdbc::XRowSet, + ::com::sun::star::sdb::XCompletedExecution, + ::com::sun::star::sdb::XRowSetApproveBroadcaster, + ::com::sun::star::sdbc::XResultSetUpdate, + ::com::sun::star::sdbcx::XDeleteRows, + ::com::sun::star::sdbc::XParameters > ODatabaseForm_BASE3; + + +class ODatabaseForm :public OFormComponents + ,public OPropertySetAggregationHelper + ,public OPropertyChangeListener + ,public ::comphelper::OAggregationArrayUsageHelper + ,public ODatabaseForm_BASE1 + ,public ODatabaseForm_BASE2 + ,public ODatabaseForm_BASE3 +{ + friend class OFormSubmitResetThread; + + OImplementationIdsRef m_aHoldIdHelper; + + // listener administration + ::cppu::OInterfaceContainerHelper m_aLoadListeners; + ::cppu::OInterfaceContainerHelper m_aRowSetApproveListeners; + ::cppu::OInterfaceContainerHelper m_aRowSetListeners; + ::cppu::OInterfaceContainerHelper m_aParameterListeners; + ::cppu::OInterfaceContainerHelper m_aResetListeners; + ::cppu::OInterfaceContainerHelper m_aSubmitListeners; + ::cppu::OInterfaceContainerHelper m_aErrorListeners; + ::osl::Mutex m_aResetSafety; + ::com::sun::star::uno::Any m_aCycle; + ::com::sun::star::uno::Any m_aIgnoreResult; // set when we are a subform and our master form positioned on a new row + ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aMasterFields; + ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aDetailFields; + ::std::vector m_aParameterVisited; + + // the object doin' most of the work - an SDB-rowset + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> m_xAggregate; + // same object, interface as member because of performance reasons + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet> m_xAggregateAsRowSet; + + OPropertyChangeMultiplexer* m_pAggregatePropertyMultiplexer; + // Verwaltung der ControlGruppen + OGroupManager* m_pGroupManager; + OParameterInfoImpl* m_pParameterInfo; + Timer* m_pLoadTimer; + + OFormSubmitResetThread* m_pThread; + ::rtl::OUString m_sCurrentErrorContext; + // will be used as additional context information + // when an exception is catched and forwarded to the listeners + + INT32 m_nResetsPending; +// + sal_Int32 m_nPrivileges; +// + +// + ::rtl::OUString m_sName; + ::rtl::OUString m_aTargetURL; + ::rtl::OUString m_aTargetFrame; + ::com::sun::star::form::FormSubmitMethod m_eSubmitMethod; + ::com::sun::star::form::FormSubmitEncoding m_eSubmitEncoding; + ::com::sun::star::form::NavigationBarMode m_eNavigation; + sal_Bool m_bAllowInsert : 1; + sal_Bool m_bAllowUpdate : 1; + sal_Bool m_bAllowDelete : 1; +// + sal_Bool m_bLoaded : 1; + sal_Bool m_bSubForm : 1; + sal_Bool m_bForwardingConnection : 1; // sal_True if we're setting the ActiveConnection on the aggregate + sal_Bool m_bSharingConnection : 1; // sal_True if the connection we're using is shared with out parent + +public: + ODatabaseForm(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + ~ODatabaseForm(); + + // UNO binding + DECLARE_UNO3_AGG_DEFAULTS(ODatabaseForm, OFormComponents); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XComponent + virtual void SAL_CALL disposing(); + + // property handling + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception ); + + ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + void fire( sal_Int32 * pnHandles, const ::com::sun::star::uno::Any * pNewValues, const ::com::sun::star::uno::Any * pOldValues, sal_Int32 nCount, sal_Bool bVetoable ); + + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + // com::sun::star::beans::XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const; + + // com::sun::star::sdbc::XSQLErrorBroadcaster + virtual void SAL_CALL addSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::form::XForm + // nothing to implement + + // com::sun::star::form::XReset + virtual void SAL_CALL reset() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::form::XSubmit + virtual void SAL_CALL submit(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& aControl, const ::com::sun::star::awt::MouseEvent& aMouseEvt) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addSubmitListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XSubmitListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSubmitListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XSubmitListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::container::XChild + virtual InterfaceRef SAL_CALL getParent() throw ( ::com::sun::star::uno::RuntimeException) { return OFormComponents::getParent(); } + virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw ( :: com::sun::star::lang::NoSupportException , ::com::sun::star::uno::RuntimeException); + + // com::sun::star::container::XNamed + virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& aName) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::awt::XTabControllerModel + virtual sal_Bool SAL_CALL getGroupControl() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroupControl(sal_Bool /*_bGroupControl*/) throw(::com::sun::star::uno::RuntimeException) { } + virtual void SAL_CALL setControlModels(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rControls) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroup(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rGroup, const ::rtl::OUString& _rGroupName) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getGroupCount() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL getGroup(sal_Int32 _nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rxGroup, ::rtl::OUString& _rName) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL getGroupByName(const ::rtl::OUString& _rName, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rxGroup) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::form::XLoadListener + virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::form::XLoadable + virtual void SAL_CALL load() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unload() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reload() throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isLoaded() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addLoadListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeLoadListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbc::XCloseable + virtual void SAL_CALL close() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbc::XRowSetListener + virtual void SAL_CALL cursorMoved(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL rowChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL rowSetChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdb::XRowSetApproveListener + virtual sal_Bool SAL_CALL approveCursorMove(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL approveRowChange(const ::com::sun::star::sdb::RowChangeEvent& event) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL approveRowSetChange(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdb::XRowSetApproveBroadcaster + virtual void SAL_CALL addRowSetApproveListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRowSetApproveListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // com::sun:star::form::XDatabaseParameterBroadcaster + virtual void SAL_CALL addParameterListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeParameterListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbc::XRowSet + virtual void SAL_CALL execute() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addRowSetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRowSetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdb::XCompletedExecution + virtual void SAL_CALL executeWithCompletion( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& handler ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbc::XResultSet + virtual sal_Bool SAL_CALL next() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isBeforeFirst() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAfterLast() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isFirst() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isLast() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL beforeFirst() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL afterLast() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL first() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL last() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL absolute(sal_Int32 row) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL relative(sal_Int32 rows) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL previous() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL refreshRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL rowUpdated() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL rowInserted() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL rowDeleted() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual InterfaceRef SAL_CALL getStatement() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbc::XResultSetUpdate + virtual void SAL_CALL insertRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL updateRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deleteRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancelRowUpdates() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL moveToInsertRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL moveToCurrentRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbcx::XDeleteRows + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& rows) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + // com::sun::star::lang::XServiceInfo + virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::lang::XServiceInfo - static version + static ::rtl::OUString SAL_CALL getImplementationName_Static(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCurrentServiceNames_Static(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCompatibleServiceNames_Static(); + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory ); + + // com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbc::XSQLErrorListener + virtual void SAL_CALL errorOccured(const ::com::sun::star::sdb::SQLErrorEvent& aEvent) throw(::com::sun::star::uno::RuntimeException); + + // com::sun::star::sdbc::XParameters + virtual void SAL_CALL setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBoolean(sal_Int32 parameterIndex, sal_Bool x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setByte(sal_Int32 parameterIndex, sal_Int8 x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setShort(sal_Int32 parameterIndex, sal_Int16 x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setInt(sal_Int32 parameterIndex, sal_Int32 x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLong(sal_Int32 parameterIndex, sal_Int64 x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFloat(sal_Int32 parameterIndex, float x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDouble(sal_Int32 parameterIndex, double x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(sal_Int32 parameterIndex, const ::rtl::OUString& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBytes(sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDate(sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTime(sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTimestamp(sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBinaryStream(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setCharacterStream(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setObject(sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setObjectWithInfo(sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRef(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBlob(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setClob(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setArray(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearParameters() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + inline void submitNBC( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt ); + +protected: + virtual void implInserted( const ElementDescription* _pElement ); + virtual void implRemoved(const InterfaceRef& _rxObject); + + // OPropertyChangeListener + virtual void _propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& ) throw(::com::sun::star::uno::RuntimeException); + +private: + sal_Bool executeRowSet(::osl::ResettableMutexGuard& _rClearForNotifies, sal_Bool bMoveToFirst = sal_True, + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()); + bool fillParameters(::osl::ResettableMutexGuard& _rClearForNotifies, + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()); + void createParameterInfo(); + bool hasValidParent() const; + // if there are no parameter infos we now that we have a complete new statement to execute + bool needStatementRebuild() const {return m_pParameterInfo == NULL;} + + // impl methods + void load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirst = sal_True, + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()) + throw(::com::sun::star::uno::RuntimeException); + void reload_impl(sal_Bool bMoveToFirst, + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()) + throw(::com::sun::star::uno::RuntimeException); + void submit_impl(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt, bool _bAproveByListeners); + void reset_impl(bool _bAproveByListeners); + + sal_Bool implEnsureConnection(); + + // connection sharing + + /// stops sharing the connection with the parent + void stopSharingConnection( ); + + /// called when the connection which we share with our parent is beeing disposed + void disposingSharedConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn ); + + /// checks if we currently share our connection with our parent + sal_Bool isSharingConnection( ) const { return m_bSharingConnection; } + + /// invalidate all our parameter-related stuff + void invlidateParameters(); + + void saveInsertOnlyState( ); + void restoreInsertOnlyState( ); + + // error handling + void onError(const ::com::sun::star::sdb::SQLErrorEvent& _rEvent); + void onError(::com::sun::star::sdbc::SQLException&, const ::rtl::OUString& _rContextDescription); + + // html tools + ::rtl::OUString GetDataURLEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); + ::rtl::OUString GetDataTextEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); + ::com::sun::star::uno::Sequence GetDataMultiPartEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt, + ::rtl::OUString& rContentType); + + void AppendComponent(HtmlSuccessfulObjList& rList, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xComponentSet, const ::rtl::OUString& rNamePrefix, + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& rxSubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); + + void FillSuccessfulList(HtmlSuccessfulObjList& rList, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& rxSubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); + + void InsertTextPart(INetMIMEMessage& rParent, const ::rtl::OUString& rName, const ::rtl::OUString& rData); + sal_Bool InsertFilePart(INetMIMEMessage& rParent, const ::rtl::OUString& rName, const ::rtl::OUString& rFileName); + void Encode(::rtl::OUString& rString) const; + + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection(); + + DECL_LINK( OnTimeout, void* ); +}; + +inline void ODatabaseForm::submitNBC(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt) +{ + submit_impl(Control, MouseEvt, sal_False); +} + +//......................................................................... +} // namespace frm +//......................................................................... + +} +#endif // _FRM_DATABASEFORM_HXX_ + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Date.hxx b/bf_forms/source/component/Date.hxx new file mode 100644 index 00000000000..1ba1ce952f9 --- /dev/null +++ b/bf_forms/source/component/Date.hxx @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_DATE_HXX_ +#define _FORMS_DATE_HXX_ + +#include "EditBase.hxx" +#include "limitedformats.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +//= ODateModel +//================================================================== +class ODateModel + :public OEditBaseModel + ,public OLimitedFormats + ,public ::comphelper::OAggregationArrayUsageHelper< ODateModel > +{ + ::com::sun::star::uno::Any m_aSaveValue; + sal_Bool m_bDateTimeField; + static sal_Int32 nDateHandle; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( ODateModel ); + +// stario::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::beans::XPropertySet + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(ODateModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//================================================================== +//= ODateControl +//================================================================== +class ODateControl: public OBoundControl +{ +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + ODateControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + DECLARE_UNO3_AGG_DEFAULTS(ODateControl, OBoundControl); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(ODateControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_DATE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Edit.hxx b/bf_forms/source/component/Edit.hxx new file mode 100644 index 00000000000..272764e34c7 --- /dev/null +++ b/bf_forms/source/component/Edit.hxx @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_EDIT_HXX_ +#define _FORMS_EDIT_HXX_ + +#include "EditBase.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + +//================================================================== +//= OEditModel +//================================================================== +class OEditModel + :public OEditBaseModel + ,public ::comphelper::OAggregationArrayUsageHelper< OEditModel > +{ + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter> m_xFormatter; + ::rtl::OUString m_aSaveValue; + sal_Int32 m_nFormatKey; + ::com::sun::star::util::Date m_aNullDate; + sal_Int32 m_nFieldType; + sal_Int16 m_nKeyType; + sal_Bool m_bMaxTextLenModified : 1; // set to when we change the MaxTextLen of the aggregate + + sal_Bool m_bWritingFormattedFake : 1; + // are we writing something which should be interpreted as formatted upon reading? + sal_Bool m_bNumericField : 1; + // are we bound to some kind of numeric field? + + static sal_Int32 nTextHandle; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + + DECLARE_DEFAULT_LEAF_XTOR( OEditModel ); + + void enableFormattedWriteFake() { m_bWritingFormattedFake = sal_True; } + void disableFormattedWriteFake() { m_bWritingFormattedFake = sal_False; } + sal_Bool lastReadWasFormattedFake() const { return (getLastReadVersion() & PF_FAKE_FORMATTED_FIELD) != 0; } + + friend InterfaceRef SAL_CALL OEditModel_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + friend class OFormattedFieldWrapper; + friend class OFormattedModel; // temporary + +public: + virtual void SAL_CALL disposing(); + + // XPropertySet + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; +// ::com::sun::star::io::XPersistObject + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OEditModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OBoundControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + virtual sal_Int16 getPersistenceFlags() const; + + DECLARE_XCLONEABLE(); +}; + +//================================================================== +//= OEditControl +//================================================================== +typedef ::cppu::ImplHelper3< ::com::sun::star::awt::XFocusListener, + ::com::sun::star::awt::XKeyListener, + ::com::sun::star::form::XChangeBroadcaster > OEditControl_BASE; + +class OEditControl : public OBoundControl + ,public OEditControl_BASE +{ + ::cppu::OInterfaceContainerHelper + m_aChangeListeners; + + ::rtl::OUString m_aHtmlChangeValue; + sal_uInt32 m_nKeyEvent; + +public: + OEditControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + virtual ~OEditControl(); + + DECLARE_UNO3_AGG_DEFAULTS(OEditControl, OBoundControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OEditControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// ::com::sun::star::form::XChangeBroadcaster + virtual void SAL_CALL addChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::awt::XFocusListener + virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw ( ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::awt::XKeyListener + virtual void SAL_CALL keyPressed(const ::com::sun::star::awt::KeyEvent& e) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL keyReleased(const ::com::sun::star::awt::KeyEvent& e) throw ( ::com::sun::star::uno::RuntimeException); + +private: + DECL_LINK( OnKeyPressed, void* ); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_EDIT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/EditBase.hxx b/bf_forms/source/component/EditBase.hxx new file mode 100644 index 00000000000..15e7c49711d --- /dev/null +++ b/bf_forms/source/component/EditBase.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_EDITBASE_HXX_ +#define _FORMS_EDITBASE_HXX_ + +#include "FormComponent.hxx" + +namespace binfilter { + +// persistence flags for use with the version id +#define PF_HANDLE_COMMON_PROPS 0x8000 + // Derived classes which use their own persistence methods (read/write) and have an own + // version handling therein may want to clear this flag in getPersistenceFlags. + // If done so, this class will write an version without a call to writeCommonEditProperties. +#define PF_FAKE_FORMATTED_FIELD 0x4000 + // .... hmmm .... a fake, as the name suggests. see OFormattedFieldWrapper +#define PF_RESERVED_2 0x2000 +#define PF_RESERVED_3 0x1000 +#define PF_RESERVED_4 0x0800 +#define PF_RESERVED_5 0x0400 +#define PF_RESERVED_6 0x0200 +#define PF_RESERVED_7 0x0100 + +#define PF_SPECIAL_FLAGS 0xFF00 + +//......................................................................... +namespace frm +{ + +//================================================================== +//= OEditBaseModel +//================================================================== +class OEditBaseModel : public OBoundControlModel +{ + sal_Int16 m_nLastReadVersion; + +protected: +// [properties] fuer all Editierfelder + ::com::sun::star::uno::Any m_aDefault; + ::rtl::OUString m_aDefaultText; // default value + sal_Bool m_bEmptyIsNull : 1; // empty string will be interepreted as NULL when committing + sal_Bool m_bFilterProposal : 1; // use a list of possible value in filtermode +// [properties] + + sal_Int16 getLastReadVersion() const { return m_nLastReadVersion; } + +public: + DECLARE_DEFAULT_XTOR( OEditBaseModel ); + + // XPersistObject + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + +protected: + // new properties common to all edit models should be handled with the following two methods + void SAL_CALL readCommonEditProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); + void SAL_CALL writeCommonEditProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + void defaultCommonEditProperties(); + + virtual sal_Int16 getPersistenceFlags() const; + // derived classes may use this if they want this base class to write additinal version flags + // (one of the PF_.... constants). After ::read they may ask for that flags with getLastReadVersion + + using OPropertySetHelper::getFastPropertyValue; +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_EDITBASE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/EventThread.hxx b/bf_forms/source/component/EventThread.hxx new file mode 100644 index 00000000000..f965817d2d6 --- /dev/null +++ b/bf_forms/source/component/EventThread.hxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_EVENT_THREAD_HXX_ +#define _FRM_EVENT_THREAD_HXX_ + +#include +#include + + +#include +#include + +#include +#include +#include +namespace binfilter { + using namespace ::comphelper; + +//......................................................................... +namespace frm +{ +//......................................................................... + +// *************************************************************************************************** +// *************************************************************************************************** + +typedef ::osl::Thread OComponentEventThread_TBASE; +class OComponentEventThread + :public OComponentEventThread_TBASE + ,public ::com::sun::star::lang::XEventListener + ,public ::cppu::OWeakObject +{ + DECLARE_STL_VECTOR(::com::sun::star::lang::EventObject*, ThreadEvents); + DECLARE_STL_VECTOR(::com::sun::star::uno::Reference< ::com::sun::star::uno::XAdapter> , ThreadObjects); + DECLARE_STL_VECTOR(sal_Bool, ThreadBools); + + ::osl::Mutex m_aMutex; + ::osl::Condition m_aCond; // Queue gefuellt? + ThreadEvents m_aEvents; // Event-Queue + ThreadObjects m_aControls; // Control fuer Submit + ThreadBools m_aFlags; // Flags fuer Submit/Reset + + ::cppu::OComponentHelper* m_pCompImpl; // Implementierung des Controls + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xComp; // ::com::sun::star::lang::XComponent des Controls + +protected: + + // XThread + virtual void SAL_CALL run(); + + virtual void SAL_CALL kill(); + virtual void SAL_CALL onTerminated(); + + // Die folgende Methode wird gerufen um das Event unter Beruecksichtigung + // seines Typs zu duplizieren. + virtual ::com::sun::star::lang::EventObject* cloneEvent(const ::com::sun::star::lang::EventObject* _pEvt) const = 0; + + // Ein Event bearbeiten. Der Mutex ist dabei nicht gelockt, pCompImpl + // bleibt aber in jedem Fall gueltig. Bei pEvt kann es sich auch um + // einen abgeleiteten Typ handeln, naemlich den, den cloneEvent + // zurueckgibt. rControl ist nur gesetzt, wenn beim addEvent ein + // Control uebergeben wurde. Da das Control nur als WeakRef gehalten + // wird kann es auch zwischenzeitlich verschwinden. + virtual void processEvent( ::cppu::OComponentHelper* _pCompImpl, + const ::com::sun::star::lang::EventObject* _pEvt, + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& _rControl, + sal_Bool _bFlag) = 0; + +public: + + // UNO Anbindung + DECLARE_UNO3_DEFAULTS(OComponentEventThread, OWeakObject); + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException); + + OComponentEventThread(::cppu::OComponentHelper* pCompImpl); + virtual ~OComponentEventThread(); + + void addEvent( const ::com::sun::star::lang::EventObject* _pEvt, sal_Bool bFlag = sal_False ); + void addEvent( const ::com::sun::star::lang::EventObject* _pEvt, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& rControl, + sal_Bool bFlag = sal_False ); + + // ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException); + +/* resolve ambiguity : both OWeakObject and OObject have these memory operators */ + void * SAL_CALL operator new( size_t size ) throw() { return osl::Thread::operator new(size); } + void SAL_CALL operator delete( void * p ) throw() { osl::Thread::operator delete(p); } + +private: + void implStarted( ); + void implTerminated( ); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_EVENT_THREAD_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/File.hxx b/bf_forms/source/component/File.hxx new file mode 100644 index 00000000000..531c8cf3d99 --- /dev/null +++ b/bf_forms/source/component/File.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_FILE_HXX_ +#define _FORMS_FILE_HXX_ + +#include "FormComponent.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +// OFileControlModel +//================================================================== +class OFileControlModel + :public OControlModel + ,public ::com::sun::star::form::XReset + ,public ::comphelper::OAggregationArrayUsageHelper< OFileControlModel > +{ + ::cppu::OInterfaceContainerHelper m_aResetListeners; + ::rtl::OUString m_sDefaultValue; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( OFileControlModel ); + + DECLARE_UNO3_AGG_DEFAULTS(OFileControlModel, OControlModel); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OFileControlModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception); + + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com ::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com ::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::form::XReset + virtual void SAL_CALL reset() throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_FILE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Filter.hxx b/bf_forms/source/component/Filter.hxx new file mode 100644 index 00000000000..8cd0085bc27 --- /dev/null +++ b/bf_forms/source/component/Filter.hxx @@ -0,0 +1,153 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef FORMS_COMPONENT_FILTER_HXX +#define FORMS_COMPONENT_FILTER_HXX + +#include +#include +#include +#include + +#include + + +#include + +#include +#include + +class Window; +namespace binfilter { + + +//......................................................................... +namespace frm +{ +//......................................................................... + + //===================================================================== + // OFilterControl + //===================================================================== + typedef ::cppu::ImplHelper5 < ::com::sun::star::awt::XTextComponent + , ::com::sun::star::awt::XFocusListener + , ::com::sun::star::awt::XItemListener + , ::com::sun::star::form::XBoundComponent + , ::com::sun::star::lang::XInitialization + > OFilterControl_BASE; + + class OFilterControl :public UnoControl + ,public OFilterControl_BASE + { + TextListenerMultiplexer m_aTextListeners; + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xField; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xMessageParent; + + ::rtl::OUString m_aText; + ::connectivity::OSQLParser m_aParser; + sal_Int16 m_nControlClass; // which kind of control do we use? + sal_Bool m_bFilterList : 1; + sal_Bool m_bMultiLine : 1; + sal_Bool m_bFilterListFilled : 1; + + public: + OFilterControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ); + + DECLARE_UNO3_AGG_DEFAULTS(OFilterControl,OWeakAggObject); + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 > & rId ); + + virtual ::rtl::OUString GetComponentServiceName(); + virtual void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > & rxToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > & rParentPeer ) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::lang::XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::awt::XTextComponent + virtual void SAL_CALL addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setText( const ::rtl::OUString& aText ) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL insertText( const ::com::sun::star::awt::Selection& rSel, const ::rtl::OUString& aText ) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getText() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getSelectedText() throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::awt::Selection SAL_CALL getSelection() throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL isEditable() throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setEditable( sal_Bool bEditable ) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setMaxTextLen( sal_Int16 nLength ) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Int16 SAL_CALL getMaxTextLen() throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::form::XBoundComponent + virtual void SAL_CALL addUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener > & /*l*/) throw( ::com::sun::star::uno::RuntimeException ) {} + virtual void SAL_CALL removeUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener > & /*l*/) throw( ::com::sun::star::uno::RuntimeException ) {} + virtual sal_Bool SAL_CALL commit() throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::awt::XFocusListener + virtual void SAL_CALL focusGained(const ::com::sun::star::awt::FocusEvent& e) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL focusLost(const ::com::sun::star::awt::FocusEvent& /*e*/) throw( ::com::sun::star::uno::RuntimeException ){} + + // ::com::sun::star::awt::XItemListener + virtual void SAL_CALL itemStateChanged(const ::com::sun::star::awt::ItemEvent& rEvent) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::util::XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + + // com::sun::star::lang::XServiceInfo - static version + static ::rtl::OUString SAL_CALL getImplementationName_Static(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCurrentServiceNames_Static(); + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory ); + + protected: + virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc ); + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + + sal_Bool ensureInitialized( ); + }; +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // FORMS_COMPONENT_FILTER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/FixedText.hxx b/bf_forms/source/component/FixedText.hxx new file mode 100644 index 00000000000..b3dfcf41cea --- /dev/null +++ b/bf_forms/source/component/FixedText.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_FIXEDTEXT_HXX_ +#define _FORMS_FIXEDTEXT_HXX_ + +#include "FormComponent.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + +//================================================================== +// OFixedTextModel +//================================================================== +class OFixedTextModel + :public OControlModel + ,public ::comphelper::OAggregationArrayUsageHelper< OFixedTextModel > +{ +public: + DECLARE_DEFAULT_LEAF_XTOR( OFixedTextModel ); + +// XPropertySetRef + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// XServiceInfo + IMPLEMENTATION_NAME(OFixedTextModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +// XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_FIXEDTEXT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/FormComponent.hxx b/bf_forms/source/component/FormComponent.hxx new file mode 100644 index 00000000000..c66fedd8b72 --- /dev/null +++ b/bf_forms/source/component/FormComponent.hxx @@ -0,0 +1,486 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_FORMCOMPONENT_HXX_ +#define _FORMS_FORMCOMPONENT_HXX_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "property.hrc" +#include "property.hxx" +#include "ids.hxx" +#include "cloneable.hxx" +namespace binfilter { + + using namespace ::comphelper; + + +//......................................................................... +namespace frm +{ +//......................................................................... + +// default tab index for components +const sal_Int16 FRM_DEFAULT_TABINDEX = 0; + +// macro for quickly implementing XServiceInfo::getImplementationName +#define IMPLEMENTATION_NAME(ImplName) \ + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException) \ + { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.forms." )) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(#ImplName)); } + +// macro for overriding the getInfoServive method of OAggregationArrayUsageHelper +#define IMPLEMENT_INFO_SERVICE() \ + virtual IPropertyInfoService* getInfoService() const { return &s_aPropInfos; } + +//================================================================== +//= substitutions for the xxx_AGGREGATION_PROPERTY_HELPER-macros +//================================================================== +#define FRM_BEGIN_PROP_HELPER(count) \ + BEGIN_AGGREGATION_PROPERTY_HELPER(count, m_xAggregateSet) \ + +#define FRM_END_PROP_HELPER() \ + END_AGGREGATION_PROPERTY_HELPER(); \ + +//========================================================================= +//= OControl +//= base class for form layer controls +//========================================================================= +typedef ::cppu::ImplHelper3 < ::com::sun::star::awt::XControl + , ::com::sun::star::lang::XEventListener + , ::com::sun::star::lang::XServiceInfo + > OControl_BASE; + +class OControl :public ::cppu::OComponentHelper + ,public OControl_BASE +{ +protected: + osl::Mutex m_aMutex; + OImplementationIdsRef m_aHoldIdHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > + m_xControl; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> + m_xAggregate; + ::rtl::OUString m_aService; + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + m_xServiceFactory; + +public: + OControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rFactory, const ::rtl::OUString& _sService); + + virtual ~OControl(); + +// UNO + DECLARE_UNO3_AGG_DEFAULTS(OControl, OComponentHelper); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); + +// XTypeProvider + virtual ::com::sun::star::uno::Sequence SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// XComponent (as base of XControl) + virtual void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException) + { OComponentHelper::dispose(); } + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) + { OComponentHelper::addEventListener(_rxListener); } + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) + { OComponentHelper::removeEventListener(_rxListener); } + +// XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw (::com::sun::star::uno::RuntimeException); + +// XServiceInfo + virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw (::com::sun::star::uno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException) = 0; + +// XControl + virtual void SAL_CALL setContext(const InterfaceRef& Context) throw (::com::sun::star::uno::RuntimeException); + virtual InterfaceRef SAL_CALL getContext() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference& Toolkit, const ::com::sun::star::uno::Reference& Parent) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference SAL_CALL getPeer() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference& Model) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference SAL_CALL getModel() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference SAL_CALL getView() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDesignMode(sal_Bool bOn) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isDesignMode() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isTransparent() throw (::com::sun::star::uno::RuntimeException); + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + // overwrite this and call the base class if you have additional types +}; + +//================================================================== +//= OBoundControl +//= a form control implementing the XBoundControl interface +//================================================================== +typedef ::cppu::ImplHelper1< ::com::sun::star::form::XBoundControl > OBoundControl_BASE; +class OBoundControl :public OControl + ,public OBoundControl_BASE +{ +protected: + sal_Bool m_bLocked : 1; + +public: + OBoundControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sService); + virtual ~OBoundControl(); + + DECLARE_UNO3_AGG_DEFAULTS(OBoundControl, OControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); + +// XBoundControl + virtual sal_Bool SAL_CALL getLock() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLock(sal_Bool _bLock) throw(::com::sun::star::uno::RuntimeException); + // default implementation just disables the controls, overwrite _setLock to change this behaviour + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + // implement the lock setting + virtual void _setLock(sal_Bool _bLock); +}; + +//================================================================== +//= OControlModel +//= model of a form layer control +//================================================================== +typedef ::cppu::ImplHelper5 < ::com::sun::star::form::XFormComponent + , ::com::sun::star::io::XPersistObject + , ::com::sun::star::container::XNamed + , ::com::sun::star::lang::XServiceInfo + , ::com::sun::star::util::XCloneable + > OControlModel_BASE; + + +class OControlModel :public ::cppu::OComponentHelper + ,public OPropertySetAggregationHelper + ,public OControlModel_BASE + ,public OCloneableAggregation +{ + +protected: + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xServiceFactory; + + ::osl::Mutex m_aMutex; + // we use this kind of mutex to check the correct using of MutexRelease + // (in the product version OCountedMutex is defined as OMutex) + + InterfaceRef m_xParent; // ParentComponent + OImplementationIdsRef m_aHoldIdHelper; + + static ConcretInfoService s_aPropInfos; + + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& + getORB( ) const { return m_xServiceFactory; } + +// + ::rtl::OUString m_aName; // name of the control + ::rtl::OUString m_aTag; // tag for additional data + sal_Int16 m_nTabIndex; // index within the taborder + sal_Int16 m_nClassId; // type of the control +// + + +protected: + OControlModel( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rFactory, // factory to create the aggregate with + const ::rtl::OUString& _rUnoControlModelTypeName, // service name of te model to aggregate + const ::rtl::OUString& rDefault = ::rtl::OUString(), // service name of the default control + const sal_Bool _bSetDelegator = sal_True // set to FALSE if you want to call setDelegator later (after returning from this ctor) + ); + OControlModel( + const OControlModel* _pOriginal, // the original object to clone + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rFactory, // factory to create the aggregate with + const sal_Bool _bSetDelegator = sal_True // set to FALSE if you want to call setDelegator later (after returning from this ctor) + ); + virtual ~OControlModel(); + + using OComponentHelper::rBHelper; + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + + void readHelpTextCompatibly(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream >& _rxInStream); + void writeHelpTextCompatibly(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream >& _rxOutStream); + + void doSetDelegator(); + void doResetDelegator(); + +public: + DECLARE_UNO3_AGG_DEFAULTS(OControl, OComponentHelper); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + +// XTypeProvider + virtual ::com::sun::star::uno::Sequence SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// XNamed + virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& aName) throw(::com::sun::star::uno::RuntimeException); + +// XServiceInfo + virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw (::com::sun::star::uno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException) = 0; + +// XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException) = 0; + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// XChild (base of XFormComponent) + virtual InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + +// XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw (::com::sun::star::uno::RuntimeException); + +// XPropertySet + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + using ::cppu::OPropertySetHelper::getFastPropertyValue; + +// ::com::sun::star::beans::XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + +// XCloneable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException) = 0; +}; + +//================================================================== +#define DECLARE_DEFAULT_XTOR( classname ) \ + classname( \ + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, \ + const ::rtl::OUString& _rUnoControlModelTypeName, \ + const ::rtl::OUString& _rDefault, \ + const sal_Bool _bSetDelegator = sal_True \ + ); \ + classname( \ + const classname* _pOriginal, \ + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, \ + const sal_Bool _bSetDelegator = sal_True \ + ); \ + ~classname() \ + +#define DECLARE_DEFAULT_LEAF_XTOR( classname ) \ + classname( \ + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory \ + ); \ + classname( \ + const classname* _pOriginal, \ + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory \ + ); \ + ~classname() \ + +//================================================================== +// XCloneable +#define DECLARE_XCLONEABLE( ) \ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException) + +#define IMPLEMENT_DEFAULT_CLONING( classname ) \ + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL classname::createClone( ) throw (::com::sun::star::uno::RuntimeException) \ + { \ + return new classname( this, getORB() ); \ + } + +//================================================================== +//= OBoundControlModel +//= model of a form layer control which is bound to a data source field +//================================================================== +typedef ::cppu::ImplHelper3< ::com::sun::star::form::XLoadListener, + ::com::sun::star::form::XReset, + ::com::sun::star::beans::XPropertyChangeListener > OBoundControlModel_BASE1; +typedef ::cppu::ImplHelper1< ::com::sun::star::form::XBoundComponent> OBoundControlModel_BASE2; + +class OBoundControlModel :public OControlModel + ,public OBoundControlModel_BASE1 + ,public OBoundControlModel_BASE2 +{ +private: + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xField; +protected: + cppu::OInterfaceContainerHelper m_aUpdateListeners; + cppu::OInterfaceContainerHelper m_aResetListeners; + + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet> m_xCursor; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate> m_xColumnUpdate; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn> m_xColumn; + + + ::rtl::OUString m_aLabelServiceName; + // when setting the label for our control (property FM_PROP_CONTROLLABEL, member m_xLabelControl), + // we accept only objects supporting an XControlModel interface, an XServiceInfo interface and + // support for a service (XServiceInfo::supportsService) determined by this string. + // Any other arguments will throw an IllegalArgumentException. + // The default value is FM_COMPONENT_FIXEDTEXT. + ::rtl::OUString m_sDataFieldConnectivityProperty; + +// + ::rtl::OUString m_aControlSource; // Datenquelle, Name des Feldes + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xLabelControl; // reference to a sibling control (model) which is our label +// + + sal_Bool m_bLoaded : 1; + sal_Bool m_bRequired : 1; + sal_Bool m_bCommitable : 1; + sal_Bool m_bForwardValueChanges : 1; + + sal_Bool m_bResetting : 1; // sal_True while in ::reset + +protected: + OBoundControlModel( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rFactory, // factory to create the aggregate with + const ::rtl::OUString& _rUnoControlModelTypeName, // service name of te model to aggregate + const ::rtl::OUString& _rDefault = ::rtl::OUString(), // service name of the default control + const sal_Bool _bCommitable = sal_True, // is the control (model) commitable ? + const sal_Bool _bSetDelegator = sal_True // set to FALSE if you want to call setDelegator later (after returning from this ctor) + ); + OBoundControlModel( + const OBoundControlModel* _pOriginal, // the original object to clone + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rFactory, // factory to create the aggregate with + const sal_Bool _bCommitable = sal_True, // is the control (model) commitable ? + const sal_Bool _bSetDelegator = sal_True // set to FALSE if you want to call setDelegator later (after returning from this ctor) + ); + virtual ~OBoundControlModel(); + + /** nFieldType ist der Typ des Feldes, an das das Model gebunden werden soll. + Das Binden erfolgt genau dann, wenn Rueckgabewert sal_True. + Die Standard-Implementation erlaubt alles ausser den drei binary-Typen und + FieldType_OTHER. + */ + virtual sal_Bool _approve(sal_Int32 _nColumnType); + + // We can't write (new) common properties in this base class, as the file format doesn't allow this + // (unfortunally). So derived classes may use the following to methods. They secured the written + // data with marks, so any new common properties in newer versions will be skipped by older ones. + void writeCommonProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + void readCommonProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); + // the next method may be used in derived classes's read when an unknown version is encountered + void defaultCommonProperties(); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + + inline const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& getField() const + { + return m_xField; + } + +public: + // UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OBoundControlModel, OControlModel); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// XReset + virtual void SAL_CALL reset( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addResetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeResetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + +// XServiceInfo + virtual StringSequence SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + +// XChild + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + +// XPersistObject + virtual void SAL_CALL write( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream >& OutStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream >& InStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// XBoundComponent + virtual sal_Bool SAL_CALL commit() throw(::com::sun::star::uno::RuntimeException); +// XUpdateBroadcaster (base of XBoundComponent) + virtual void SAL_CALL addUpdateListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeUpdateListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + +// XPropertySet + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + using ::cppu::OPropertySetHelper::getFastPropertyValue; + +// XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw (::com::sun::star::uno::RuntimeException); + +// XPropertyChangeListener + virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException); + +// XLoadListener + virtual void SAL_CALL loaded( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloading( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloaded( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloading( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloaded( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); + +private: + void resetField() { m_xColumnUpdate = NULL; m_xColumn = NULL; m_xField = NULL; } +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_FORMCOMPONENT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/FormattedField.hxx b/bf_forms/source/component/FormattedField.hxx new file mode 100644 index 00000000000..c4ef1e8bdf1 --- /dev/null +++ b/bf_forms/source/component/FormattedField.hxx @@ -0,0 +1,199 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_FORMATTEDFIELD_HXX_ +#define _FORMS_FORMATTEDFIELD_HXX_ + +#include "EditBase.hxx" + +#include + +#include +#include +#include "errorbroadcaster.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + + //================================================================== + //= OFormattedModel + //================================================================== + + class OFormattedModel + :public OEditBaseModel + ,public OErrorBroadcaster + ,public OPropertyChangeListener + ,public ::comphelper::OAggregationArrayUsageHelper< OFormattedModel > + { + OPropertyChangeMultiplexer* m_pPropertyMultiplexer; + + // das Original, falls ich die Format-Properties meines aggregierten Models gefaket, d.h. von dem Feld, an das + // ich gebunden bin, weitergereicht habe (nur gueltig wenn loaded) + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> m_xOriginalFormatter; + ::com::sun::star::util::Date m_aNullDate; + ::com::sun::star::uno::Any m_aSaveValue; + + sal_Int32 m_nFieldType; + sal_Int16 m_nKeyType; + sal_Bool m_bOriginalNumeric : 1, + m_bNumeric : 1, // analog fuer TreatAsNumeric-Property + m_bAggregateListening : 1; + + static ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > s_xDefaultFormatter; + static sal_Int32 nValueHandle; + // falls ich wirklich mal einen selber benutzen muss, wird der zwischen allen Instanzen geteilt + + protected: + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> calcDefaultFormatsSupplier() const; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> calcFormFormatsSupplier() const; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> calcFormatsSupplier() const; + DECLARE_DEFAULT_LEAF_XTOR( OFormattedModel ); + + friend class OFormattedFieldWrapper; + + /// starts multiplexing the aggregate's property changes + void startAggregateListening(); + /// stops multiplexing the aggregate's property changes + void stopAggregateListening(); + /// release the aggregate listener + void releaseAggregateListener(); + + protected: + // XInterface + DECLARE_UNO3_AGG_DEFAULTS( OFormattedModel, OEditBaseModel ); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + + // XAggregation + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + // XServiceInfo + IMPLEMENTATION_NAME(OFormattedModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + + // XPersistObject + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception); + + // XLoadListener + virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& rEvent) throw ( ::com::sun::star::uno::RuntimeException); + + // XPropertyState + void setPropertyToDefaultByHandle(sal_Int32 nHandle); + ::com::sun::star::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const; + + void SAL_CALL setPropertyToDefault(const ::rtl::OUString& aPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OBoundControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + + // XPropertyChangeListener + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException); + + protected: + virtual sal_Int16 getPersistenceFlags() const; + // as we have an own version handling for persistence + + protected: + DECLARE_XCLONEABLE(); + + void implConstruct(); + }; + + //================================================================== + //= OFormattedControl + //================================================================== + typedef ::cppu::ImplHelper1< ::com::sun::star::awt::XKeyListener> OFormattedControl_BASE; + class OFormattedControl : public OBoundControl + ,public OFormattedControl_BASE + { + sal_uInt32 m_nKeyEvent; + + public: + OFormattedControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + virtual ~OFormattedControl(); + + DECLARE_UNO3_AGG_DEFAULTS(OFormattedControl, OBoundControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OFormattedControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + + // ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XKeyListener + virtual void SAL_CALL keyPressed(const ::com::sun::star::awt::KeyEvent& e) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL keyReleased(const ::com::sun::star::awt::KeyEvent& e) throw ( ::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControl + virtual void SAL_CALL setDesignMode(sal_Bool bOn) throw ( ::com::sun::star::uno::RuntimeException); + + using OControl::disposing; + + private: + DECL_LINK( OnKeyPressed, void* ); + }; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_FORMATTEDFIELD_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/FormattedFieldWrapper.hxx b/bf_forms/source/component/FormattedFieldWrapper.hxx new file mode 100644 index 00000000000..0527e76325c --- /dev/null +++ b/bf_forms/source/component/FormattedFieldWrapper.hxx @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_FORMATTED_FIELD_WRAPPER_HXX_ +#define _FRM_FORMATTED_FIELD_WRAPPER_HXX_ + +#include "FormComponent.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + +class OEditModel; +//================================================================== +//= OFormattedFieldWrapper +//================================================================== +typedef ::cppu::WeakAggImplHelper3 < ::com::sun::star::io::XPersistObject + , ::com::sun::star::lang::XServiceInfo + , ::com::sun::star::util::XCloneable + > OFormattedFieldWrapper_Base; + +class OFormattedFieldWrapper : public OFormattedFieldWrapper_Base +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xServiceFactory; + +protected: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> m_xAggregate; + + OEditModel* m_pEditPart; + // if we act as formatted this is used to write the EditModel part + ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject> m_xFormattedPart; + // if we act as formatted, this is the PersistObject interface of our aggregate, used + // to read and write the FormattedModel part + + OFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, sal_Bool _bActAsFormatted); + // if _bActAsFormatted is sal_False, the state is undetermined until somebody calls ::read or does + // anything which requires a living aggregate + OFormattedFieldWrapper( const OFormattedFieldWrapper* _pCloneSource ); + virtual ~OFormattedFieldWrapper(); + + friend InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + friend InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + +public: + // UNO + DECLARE_UNO3_AGG_DEFAULTS(OFormattedFieldWrapper, OWeakAggObject); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + + // XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // XCloneable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException); + +protected: + /// ensure we're in a defined state, which means a FormattedModel _OR_ an EditModel + void ensureAggregate(); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_FORMATTED_FIELD_WRAPPER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/FormsCollection.hxx b/bf_forms/source/component/FormsCollection.hxx new file mode 100644 index 00000000000..8e3da201c28 --- /dev/null +++ b/bf_forms/source/component/FormsCollection.hxx @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "InterfaceContainer.hxx" + +#include + +#include "ids.hxx" + +#include +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +// OFormsCollection +// Implementiert den UNO-Container fuer Formulare +// enthaelt alle zugeordneten Forms +// dieses Container kann selbst den Context fuer Formulare darstellen +// oder aussen einen Context uebergeben bekommen +//================================================================== +typedef ::cppu::OComponentHelper FormsCollectionComponentBase; +typedef ::cppu::ImplHelper2< ::com::sun::star::container::XChild + ,::com::sun::star::lang::XServiceInfo > OFormsCollection_BASE; + + // else MSVC kills itself on some statements +class OFormsCollection + :public FormsCollectionComponentBase + ,public OInterfaceContainer + ,public OFormsCollection_BASE +{ + ::osl::Mutex m_aMutex; + OImplementationIdsRef m_aHoldIdHelper; + ::comphelper::InterfaceRef m_xParent; // Parent + +public: + OFormsCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + virtual ~OFormsCollection(); + +public: + DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection, FormsCollectionComponentBase); + + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + +// XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + +// XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// ::com::sun::star::container::XChild + virtual ::comphelper::InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent(const ::comphelper::InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + using OInterfaceContainer::disposing; +}; + +//......................................................................... +} // namespace frm +//......................................................................... +}//end of namespace binfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Grid.hxx b/bf_forms/source/component/Grid.hxx new file mode 100644 index 00000000000..73c6ac10d70 --- /dev/null +++ b/bf_forms/source/component/Grid.hxx @@ -0,0 +1,225 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "FormComponent.hxx" + +#include +#include +#include + +#include + +#include "InterfaceContainer.hxx" + +#include +#include +#include "errorbroadcaster.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +class OGridColumn; + +//================================================================== +// ColumnDescription +//================================================================== + + struct ColumnDescription : public ElementDescription + { + public: + OGridColumn* pColumn; // not owned by this instance! only to prevent duplicate XUnoTunnel usage + }; + +//================================================================== +// OGridControlModel +//================================================================== +typedef ::cppu::ImplHelper6 < ::com::sun::star::awt::XControlModel + , ::com::sun::star::form::XGridColumnFactory + , ::com::sun::star::form::XLoadListener + , ::com::sun::star::form::XReset + , ::com::sun::star::view::XSelectionSupplier + , ::com::sun::star::sdb::XSQLErrorListener + > OGridControlModel_BASE; + +class OGridControlModel :public OControlModel + ,public OInterfaceContainer + ,public OErrorBroadcaster + ,public OAggregationArrayUsageHelper< OGridControlModel > + // though we don't use aggregation, we're derived from an OPropertySetAggregationHelper, + // which expects that we use an OPropertyArrayAggregationHelper, which we ensure + // with deriving from OAggregationArrayUsageHelper + ,public OGridControlModel_BASE +{ + ::cppu::OInterfaceContainerHelper m_aSelectListeners, + m_aResetListeners; + +// [properties] + ::com::sun::star::uno::Any m_aRowHeight; // Zeilenhoehe + ::com::sun::star::uno::Any m_aTabStop; + ::com::sun::star::uno::Any m_aTextColor; + ::com::sun::star::uno::Any m_aBackgroundColor; + ::com::sun::star::uno::Any m_aCursorColor; // transient + ::com::sun::star::awt::FontDescriptor m_aFont; + ::com::sun::star::awt::FontDescriptor m_aOldFont; + ::rtl::OUString m_aDefaultControl; + ::rtl::OUString m_sHelpText; + ::com::sun::star::uno::Any m_aTextLineColor; + sal_Int16 m_nFontRelief; + sal_Int16 m_nFontEmphasis; +// [properties] + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xSelection; + ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable > m_xParentFormLoadable; + sal_uInt32 m_nFontEvent; + +// [properties] + ::rtl::OUString m_sHelpURL; // URL + sal_Int16 m_nBorder; + sal_Bool m_bEnable : 1; + sal_Bool m_bNavigation : 1; + sal_Bool m_bRecordMarker : 1; + sal_Bool m_bPrintable : 1; + sal_Bool m_bAlwaysShowCursor : 1; // transient + sal_Bool m_bDisplaySynchron : 1; // transient +// [properties] + +public: + DECLARE_DEFAULT_LEAF_XTOR( OGridControlModel ); + +// UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OControlModel); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + +// starcontainer::XChild + virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OGridControlModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +// XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::form::XLoadListener + virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::form::XReset + virtual void SAL_CALL reset() throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::view::XSelectionSupplier + virtual sal_Bool SAL_CALL select(const ::com::sun::star::uno::Any& aElement) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getSelection() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addSelectionChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSelectionChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::form::XGridColumnFactory + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> SAL_CALL createColumn(const ::rtl::OUString& ColumnType) throw ( :: com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual StringSequence SAL_CALL getColumnTypes() throw ( ::com::sun::star::uno::RuntimeException); + +// stario::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception); + +// ::com::sun::star::beans::XPropertyState + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + +// ::com::sun::star::sdb::XSQLErrorListener + virtual void SAL_CALL errorOccured( const ::com::sun::star::sdb::SQLErrorEvent& _rEvent ) throw (::com::sun::star::uno::RuntimeException); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + // prevent method hiding + using OControlModel::disposing; + using OControlModel::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); + +protected: + virtual void approveNewElement( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject, + ElementDescription* _pElement + ); + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> createColumn(sal_Int32 nTypeId) const; + + OGridColumn* getColumnImplementation(const InterfaceRef& _rxIFace) const; + + virtual ElementDescription* createElementMetaData( ); + +protected: + virtual void implRemoved(const InterfaceRef& _rxObject); + virtual void implInserted( const ElementDescription* _pElement ); + virtual void implReplaced( const InterfaceRef& _rxReplacedObject, const ElementDescription* _pElement ); + + void gotColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxColumn); + void lostColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxColumn); + + void cloneColumns( const OGridControlModel* _pOriginalContainer ); + +private: + DECL_LINK( OnFontChanged, void* ); +}; + +//......................................................................... +} // namespace frm +//......................................................................... +}//end of namespace binfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/GroupBox.hxx b/bf_forms/source/component/GroupBox.hxx new file mode 100644 index 00000000000..47f354e4646 --- /dev/null +++ b/bf_forms/source/component/GroupBox.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_GROUPBOX_HXX_ +#define _FORMS_GROUPBOX_HXX_ + +#include "FormComponent.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + +//================================================================== +// OGroupBoxModel +//================================================================== +class OGroupBoxModel + :public OControlModel + ,public ::comphelper::OAggregationArrayUsageHelper< OGroupBoxModel > +{ +public: + DECLARE_DEFAULT_LEAF_XTOR( OGroupBoxModel ); + + // XServiceInfo + IMPLEMENTATION_NAME(OGroupBoxModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // XPropertySetRef + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//================================================================== +// OGroupBoxControl (nur aus Kompatibilitaet zur 5.0) +//================================================================== +class OGroupBoxControl : public OControl +{ +public: + OGroupBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + + // XServiceInfo + IMPLEMENTATION_NAME(OGroupBoxControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_GROUPBOX_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/GroupManager.hxx b/bf_forms/source/component/GroupManager.hxx new file mode 100644 index 00000000000..b8b59fffad0 --- /dev/null +++ b/bf_forms/source/component/GroupManager.hxx @@ -0,0 +1,230 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_GROUPMANAGER_HXX_ +#define _FRM_GROUPMANAGER_HXX_ + +#include +#include +#include + + +#include + +#include +namespace binfilter { + using namespace ::comphelper; + +/*======================================================================== +Funktionsweise GroupManager: + +Der GroupManager horcht an der starform, ob FormComponents eingefuegt oder entfernt +werden. Zusaetzlich horcht er bei den FormComponents an den Properties +"Name" und "TabIndex". Mit diesen Infos aktualisiert er seine Gruppen. + +Der GroupManager verwaltet eine Gruppe, in der alle Controls nach TabIndex +geordnet sind, und ein Array von Gruppen, in dem jede FormComponent noch +einmal einer Gruppe dem Namen nach zugeordnet wird. +Die einzelnen Gruppen werden ueber eine Map aktiviert, wenn sie mehr als +ein Element besitzen. + +Die Gruppen verwalten intern die FormComponents in zwei Arrays. In dem +GroupCompArray werden die Components nach TabIndex und Einfuegepostion +sortiert. Da auf dieses Array ueber die FormComponent zugegriffen +wird, gibt es noch das GroupCompAccessArray, in dem die FormComponents +nach ihrer Speicheradresse sortiert sind. Jedes Element des +GroupCompAccessArrays ist mit einem Element des GroupCompArrays verpointert. + +========================================================================*/ + +//......................................................................... +namespace frm +{ +//......................................................................... + +//======================================================================== + template + sal_Int32 insert_sorted(::std::vector& _rArray, const ELEMENT& _rNewElement, const LESS_COMPARE& _rCompareOp) + { + typename ::std::vector::iterator aInsertPos = lower_bound( + _rArray.begin(), + _rArray.end(), + _rNewElement, + _rCompareOp + ); + aInsertPos = _rArray.insert(aInsertPos, _rNewElement); + return aInsertPos - _rArray.begin(); + } + + template + sal_Bool seek_entry(const ::std::vector& _rArray, const ELEMENT& _rNewElement, sal_Int32& nPos, const LESS_COMPARE& _rCompareOp) + { + typename ::std::vector::const_iterator aExistentPos = lower_bound( + _rArray.begin(), + _rArray.end(), + _rNewElement, + _rCompareOp + ); + if ((aExistentPos != _rArray.end()) && (*aExistentPos == _rNewElement)) + { // we have a valid "lower or equal" element and it's really "equal" + nPos = aExistentPos - _rArray.begin(); + return sal_True; + } + nPos = -1; + return sal_False; + } + +//======================================================================== +class OGroupComp +{ + ::rtl::OUString m_aName; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xComponent; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> m_xControlModel; + sal_Int32 m_nPos; + sal_Int16 m_nTabIndex; + + friend class OGroupCompLess; + +public: + OGroupComp(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& rxElement, sal_Int32 nInsertPos ); + OGroupComp(const OGroupComp& _rSource); + OGroupComp(); + + sal_Bool operator==( const OGroupComp& rComp ) const; + + inline const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& GetComponent() const { return m_xComponent; } + inline const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& GetControlModel() const { return m_xControlModel; } + + sal_Int32 GetPos() const { return m_nPos; } + sal_Int16 GetTabIndex() const { return m_nTabIndex; } + ::rtl::OUString GetName() const { return m_aName; } +}; + +DECLARE_STL_VECTOR(OGroupComp, OGroupCompArr); + +//======================================================================== +class OGroupComp; +class OGroupCompAcc +{ + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xComponent; + + OGroupComp m_aGroupComp; + + friend class OGroupCompAccLess; + +public: + OGroupCompAcc(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& rxElement, const OGroupComp& _rGroupComp ); + + sal_Bool operator==( const OGroupCompAcc& rCompAcc ) const; + + inline const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& GetComponent() const { return m_xComponent; } + const OGroupComp& GetGroupComponent() const { return m_aGroupComp; } +}; + +DECLARE_STL_VECTOR(OGroupCompAcc, OGroupCompAccArr); + +//======================================================================== +class OGroup +{ + OGroupCompArr m_aCompArray; + OGroupCompAccArr m_aCompAccArray; + + ::rtl::OUString m_aGroupName; + sal_uInt16 m_nInsertPos; // Die Einfugeposition der GroupComps wird von der Gruppe bestimmt. + + friend class OGroupLess; + +public: + OGroup( const ::rtl::OUString& rGroupName ); +#ifdef DBG_UTIL + OGroup( const OGroup& _rSource ); // just to ensure the DBG_CTOR call +#endif + virtual ~OGroup(); + + sal_Bool operator==( const OGroup& rGroup ) const; + + ::rtl::OUString GetGroupName() const { return m_aGroupName; } + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > GetControlModels() const; + + void InsertComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& rxElement ); + void RemoveComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& rxElement ); + sal_uInt16 Count() const { return m_aCompArray.size(); } + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& GetObject( sal_uInt16 nP ) const + { return m_aCompArray[nP].GetComponent(); } +}; + +DECLARE_STL_USTRINGACCESS_MAP(OGroup, OGroupArr); +DECLARE_STL_VECTOR(OGroupArr::iterator, OActiveGroups); + +//======================================================================== +class OGroupManager : public ::cppu::WeakImplHelper2< ::com::sun::star::beans::XPropertyChangeListener, ::com::sun::star::container::XContainerListener> +{ + OGroup* m_pCompGroup; // Alle Components nach TabIndizes sortiert + OGroupArr m_aGroupArr; // Alle Components nach Gruppen sortiert + OActiveGroups m_aActiveGroupMap; // In dieser Map werden die Indizes aller Gruppen gehalten, + // die mehr als 1 Element haben + + ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer > + m_xContainer; + + // Helper functions + void InsertElement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& rxElement ); + void RemoveElement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& rxElement ); + void removeFromGroupMap(const ::rtl::OUString& _sGroupName,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xSet); + +public: + OGroupManager(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >& _rxContainer); + virtual ~OGroupManager(); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::beans::XPropertyChangeListener + virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw ( ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XContainerListener + virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& _rEvent) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& _rEvent) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& _rEvent) throw ( ::com::sun::star::uno::RuntimeException); + +// Other functions + sal_Int32 getGroupCount(); + void getGroup(sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup, ::rtl::OUString& Name); + void getGroupByName(const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > getControlModels(); +}; + + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_GROUPMANAGER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Hidden.hxx b/bf_forms/source/component/Hidden.hxx new file mode 100644 index 00000000000..6137c3ffd8b --- /dev/null +++ b/bf_forms/source/component/Hidden.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_HIDDEN_HXX_ +#define _FORMS_HIDDEN_HXX_ + +#include "FormComponent.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + +//================================================================== +// OHiddenModel +//================================================================== +class OHiddenModel + :public OControlModel + ,public ::comphelper::OAggregationArrayUsageHelper< OHiddenModel > +{ + ::rtl::OUString m_sHiddenValue; + +public: + DECLARE_DEFAULT_LEAF_XTOR( OHiddenModel ); + + // OPropertySetHelper + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + + // XPropertySetRef + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // XServiceInfo + IMPLEMENTATION_NAME(OHiddenModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE( ); +}; + +} +#endif // _FORMS_HIDDEN_HXX_ + +//......................................................................... +}//end of namespace binfilter +//......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Image.hxx b/bf_forms/source/component/Image.hxx new file mode 100644 index 00000000000..8bdda6f594e --- /dev/null +++ b/bf_forms/source/component/Image.hxx @@ -0,0 +1,230 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_IMAGE_HXX_ +#define _FRM_IMAGE_HXX_ + +#include "FormComponent.hxx" + +#include "EventThread.hxx" + +#include +#include "imgprod.hxx" + +#include +#include +#include +#include +#include +namespace binfilter { + + +class SfxMedium; + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +// OImageModel +//================================================================== +typedef ::cppu::ImplHelper2 < ::com::sun::star::form::XImageProducerSupplier + , ::com::sun::star::awt::XImageProducer + > OImageModel_Base; + +class OImageModel :public OImageModel_Base + ,public OControlModel + ,public OPropertyChangeListener +{ +protected: + ::com::sun::star::form::FormButtonType m_eButtonType; // Art des Buttons (push,submit,reset) + ::rtl::OUString m_sTargetURL; // starutil::URL fuer den starutil::URL-Button + ::rtl::OUString m_sTargetFrame; // TargetFrame zum Oeffnen + +// ImageProducer stuff + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> m_xProducer; + SfxMedium* m_pMedium; // Download-Medium + ImageProducer* m_pProducer; + sal_Bool m_bDispatchUrlInternal; // property: is not allowed to set : 1 + sal_Bool m_bDownloading : 1; // laeuft ein Download? + sal_Bool m_bProdStarted : 1; + + + + DECL_STATIC_LINK( OImageModel, DataAvailableLink, void* ); + DECL_STATIC_LINK( OImageModel, DownloadDoneLink, void* ); + + inline ImageProducer* GetImageProducer() { return m_pProducer; } + + void StartProduction(); + void SetURL(const ::rtl::OUString& rURL); + void DataAvailable(); + void DownloadDone(); + + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + inline sal_Bool isDispatchUrlInternal() const { return m_bDispatchUrlInternal; } + inline void setDispatchUrlInternal(sal_Bool _bDispatch) { m_bDispatchUrlInternal = _bDispatch; } + +public: + DECLARE_DEFAULT_XTOR( OImageModel ); + + // UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OImageModel, OControlModel); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// ::com::sun::star::form::XImageProducerSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> SAL_CALL getImageProducer() throw (::com::sun::star::uno::RuntimeException) { return m_xProducer; } + +// OPropertySetHelper + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); + + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + +// OPropertyChangeListener + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent&) throw(::com::sun::star::uno::RuntimeException); + +// XPersistObject + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::beans::XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + +// XImageProducer + virtual void SAL_CALL addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException); + + using OControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + +protected: + void implConstruct(); + + // to be called from within the cloning-ctor of your derived class + void implInitializeImageURL( ); +}; + +//================================================================== +// OImageControl +//================================================================== +typedef ::cppu::ImplHelper2< ::com::sun::star::form::XApproveActionBroadcaster, + ::com::sun::star::beans::XPropertyChangeListener> OImageControl_BASE; +class OImageControlThread_Impl; + +class OImageControl : public OImageControl_BASE, + public OControl +{ + friend class OImageControlThread_Impl; + +protected: + ::cppu::OInterfaceContainerHelper + m_aApproveActionListeners, + m_aActionListeners; + ::rtl::OUString m_aActionCommand; + + OImageControlThread_Impl *m_pThread; + +public: + OImageControl( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, + const ::rtl::OUString& _aService); + virtual ~OImageControl(); + +// UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OImageControl, OControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// ::com::sun::star::form::XApproveActionBroadcaster + virtual void SAL_CALL addApproveActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XApproveActionListener>& _rxListener) + throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeApproveActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XApproveActionListener>& _rxListener) + throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::awt::XControl + virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>& _rToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& Parent) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& Model) throw (::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::beans::XPropertyChangeListener + virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& ) throw(::com::sun::star::uno::RuntimeException); + + using OControl::disposing; + +protected: + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getXModel(const InterfaceRef& xIface) const; + + virtual void actionPerformed_Impl( sal_Bool bNotifyListener, const ::com::sun::star::awt::MouseEvent& rEvt = ::com::sun::star::awt::MouseEvent()); + + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); +}; + +//================================================================== +// OImageControlThread_Impl +//================================================================== +class OImageControlThread_Impl: public OComponentEventThread +{ +protected: + + // Die folgende Methode wrrd gerufen um das Event unter Beruecksichtigung + // seines Typs zu duplizieren + virtual ::com::sun::star::lang::EventObject* cloneEvent( const ::com::sun::star::lang::EventObject* _pEvt ) const; + + // Ein Event bearbeiten. Der Mutex ist dabei nicht gelockt, pCompImpl + // bleibt aber in jedem Fall gueltig. + virtual void processEvent( ::cppu::OComponentHelper *pCompImpl, + const ::com::sun::star::lang::EventObject*, + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>&, + sal_Bool ); + +public: + OImageControlThread_Impl( OImageControl *pControl ) : + OComponentEventThread( pControl ) + {} + + void addEvent() { ::com::sun::star::lang::EventObject aEvt; OComponentEventThread::addEvent( &aEvt ); } +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_IMAGE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/ImageButton.hxx b/bf_forms/source/component/ImageButton.hxx new file mode 100644 index 00000000000..c9222d94c20 --- /dev/null +++ b/bf_forms/source/component/ImageButton.hxx @@ -0,0 +1,118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_IMAGE_BUTTON_HXX_ +#define _FRM_IMAGE_BUTTON_HXX_ + +#include "Image.hxx" + +#include +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +// OImageButtonModel +//================================================================== +class OImageButtonModel + :public OImageModel + ,public ::comphelper::OAggregationArrayUsageHelper< OImageButtonModel > +{ +public: + DECLARE_DEFAULT_LEAF_XTOR( OImageButtonModel ); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OImageButtonModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//================================================================== +// OImageButtonControl +//================================================================== +typedef ::cppu::ImplHelper1< ::com::sun::star::awt::XMouseListener> OImageButtonControl_BASE; +class OImageButtonControl : public OImageControl, + public OImageButtonControl_BASE +{ +protected: + // UNO Anbindung + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + OImageButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OImageButtonControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + + // UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OImageButtonControl, OImageControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) + { OControl::disposing(_rSource); } + + using OImageControl::disposing; + +// ::com::sun::star::awt::XMouseListener + virtual void SAL_CALL mousePressed(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL mouseReleased(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException) { } + virtual void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException) { } + virtual void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException) { } +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_IMAGE_BUTTON_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/ImageControl.hxx b/bf_forms/source/component/ImageControl.hxx new file mode 100644 index 00000000000..959d9b0a805 --- /dev/null +++ b/bf_forms/source/component/ImageControl.hxx @@ -0,0 +1,185 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRM_IMAGE_CONTROL_HXX_ +#define _FRM_IMAGE_CONTROL_HXX_ + +#include "FormComponent.hxx" + +#include "imgprod.hxx" + +#include +#include + +#include +#include +namespace binfilter { + + using namespace ::comphelper; + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +// OImageControlModel +//================================================================== +typedef ::cppu::ImplHelper2 < ::com::sun::star::form::XImageProducerSupplier + , ::com::sun::star::awt::XImageProducer + > OImageControlModel_Base; + +class OImageControlModel + :public OImageControlModel_Base + ,public ::comphelper::OAggregationArrayUsageHelper + ,public OBoundControlModel + ,public OPropertyChangeListener +{ + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> m_xImageProducer; + ImageProducer* m_pImageProducer; + sal_Bool m_bReadOnly; + + OPropertyChangeMultiplexer* m_pAggregatePropertyMultiplexer; + +protected: + // UNO Anbindung + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + + virtual sal_Bool _approve(sal_Int32 _nColumnType); + + inline ImageProducer* GetImageProducer() { return m_pImageProducer; } + +public: + DECLARE_DEFAULT_LEAF_XTOR( OImageControlModel ); + + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception); + + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + + // UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OImageControlModel, OBoundControlModel); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::form::XBoundComponent + virtual ::com::sun::star::uno::Any _getControlValue() const; + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OImageControlModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// OPropertyChangeListener + virtual void _propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& ) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::form::XImageProducerSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> SAL_CALL getImageProducer() throw ( ::com::sun::star::uno::RuntimeException); + +// XImageProducer + virtual void SAL_CALL addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException); + +// ::comphelper::OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OBoundControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); + + void implConstruct(); +}; + +//================================================================== +// OImageControlControl +//================================================================== +class OImageControlControl : public ::com::sun::star::awt::XMouseListener, + public OBoundControl +{ +protected: + // UNO Anbindung + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + OImageControlControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + +// UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OImageControlControl, OBoundControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) + { OBoundControl::disposing(_rSource); } + +// ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OImageControlControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + +// ::com::sun::star::awt::XMouseListener + virtual void SAL_CALL mousePressed(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL mouseReleased(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException) { } + virtual void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException) { } + virtual void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& /*e*/) throw ( ::com::sun::star::uno::RuntimeException) { } + +// ::com::sun::star::awt::XControl + virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>& _rToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& _rParent) throw(::com::sun::star::uno::RuntimeException); + + using OControl::disposing; + +private: + void implClearGraphics(); + void implInsertGraphics(); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_IMAGE_CONTROL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/ListBox.hxx b/bf_forms/source/component/ListBox.hxx new file mode 100644 index 00000000000..2747608e837 --- /dev/null +++ b/bf_forms/source/component/ListBox.hxx @@ -0,0 +1,199 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_LISTBOX_HXX_ +#define _FORMS_LISTBOX_HXX_ + +#include "FormComponent.hxx" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "errorbroadcaster.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ + +const ::rtl::OUString LISTBOX_EMPTY_VALUE( RTL_CONSTASCII_USTRINGPARAM( "$$$empty$$$" )); + +//================================================================== +//= OListBoxModel +//================================================================== +typedef ::cppu::ImplHelper1 < ::com::sun::star::util::XRefreshable + > OListBoxModel_BASE; + +class OListBoxModel :public OBoundControlModel + ,public OListBoxModel_BASE + ,public OErrorBroadcaster + ,public ::comphelper::OAggregationArrayUsageHelper< OListBoxModel > +{ + ::com::sun::star::uno::Any m_aSaveValue; + + // + ::com::sun::star::form::ListSourceType m_eListSourceType; // type der list source + ::com::sun::star::uno::Any m_aBoundColumn; + StringSequence m_aListSourceSeq; // + StringSequence m_aValueSeq; // alle Werte, readonly + ::com::sun::star::uno::Sequence m_aDefaultSelectSeq; // DefaultSelected + // + + ::cppu::OInterfaceContainerHelper m_aRefreshListeners; + + static sal_Int32 nSelectHandle; + // [properties] + + sal_Int16 m_nNULLPos; // Position an der der NULLwert abgelegt wird + sal_Bool m_bBoundComponent : 1; + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( OListBoxModel ); + +// XServiceInfo + IMPLEMENTATION_NAME(OListBoxModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +// UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OListBoxModel, OBoundControlModel); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// OPropertySetHelper + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + +// XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +// XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// XRefreshable + virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OBoundControlModel::disposing; + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + void loadData(); + + DECLARE_XCLONEABLE(); +}; + +//================================================================== +//= OListBoxControl +//================================================================== +typedef ::cppu::ImplHelper3< ::com::sun::star::awt::XFocusListener, + ::com::sun::star::awt::XItemListener, + ::com::sun::star::form::XChangeBroadcaster > OListBoxControl_BASE; + +class OListBoxControl :public OBoundControl + ,public OListBoxControl_BASE +{ + ::cppu::OInterfaceContainerHelper m_aChangeListeners; + + ::com::sun::star::uno::Any m_aCurrentSelection; + Timer m_aChangeTimer; + +protected: + // UNO Anbindung + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + OListBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + virtual ~OListBoxControl(); + + // UNO Anbindung + DECLARE_UNO3_AGG_DEFAULTS(OListBoxControl, OBoundControl); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + +// XServiceInfo + IMPLEMENTATION_NAME(OListBoxControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +// XChangeBroadcaster + virtual void SAL_CALL addChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + +// XFocusListener + virtual void SAL_CALL focusGained(const ::com::sun::star::awt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL focusLost(const ::com::sun::star::awt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); + +// XItemListener + virtual void SAL_CALL itemStateChanged(const ::com::sun::star::awt::ItemEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); + +// XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw (::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +private: + DECL_LINK( OnTimeout, void* ); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_LISTBOX_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Numeric.hxx b/bf_forms/source/component/Numeric.hxx new file mode 100644 index 00000000000..14702d37823 --- /dev/null +++ b/bf_forms/source/component/Numeric.hxx @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_NUMERIC_HXX_ +#define _FORMS_NUMERIC_HXX_ + +#include "EditBase.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +//= ONumericModel +//================================================================== +class ONumericModel + :public OEditBaseModel + ,public ::comphelper::OAggregationArrayUsageHelper< ONumericModel > +{ + ::com::sun::star::uno::Any m_aSaveValue; + static sal_Int32 nValueHandle; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( ONumericModel ); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(ONumericModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + + // ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//================================================================== +//= ONumericControl +//================================================================== +class ONumericControl: public OBoundControl +{ +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + ONumericControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(ONumericControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_NUMERIC_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Pattern.hxx b/bf_forms/source/component/Pattern.hxx new file mode 100644 index 00000000000..c089d7d2493 --- /dev/null +++ b/bf_forms/source/component/Pattern.hxx @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_PATTERN_HXX_ +#define _FORMS_PATTERN_HXX_ + +#include "EditBase.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +//= OPatternModel +//================================================================== +class OPatternModel + :public OEditBaseModel + ,public ::comphelper::OAggregationArrayUsageHelper< OPatternModel > +{ + ::rtl::OUString m_aSaveValue; + + static sal_Int32 nTextHandle; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( OPatternModel ); + + // ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OPatternModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + + // ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//================================================================== +//= OPatternControl +//================================================================== +class OPatternControl: public OBoundControl +{ +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + OPatternControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OPatternControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_PATTERN_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/RadioButton.hxx b/bf_forms/source/component/RadioButton.hxx new file mode 100644 index 00000000000..a3dcbdd7507 --- /dev/null +++ b/bf_forms/source/component/RadioButton.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_RADIOBUTTON_HXX_ +#define _FORMS_RADIOBUTTON_HXX_ + +#include "FormComponent.hxx" + +#include +namespace binfilter { + +//......................................................................... +namespace frm +{ + +enum { RB_NOCHECK, RB_CHECK, RB_DONTKNOW }; + +//================================================================== +// ORadioButtonModel +//================================================================== +class ORadioButtonModel :public OBoundControlModel + ,public OPropertyChangeListener + ,public ::comphelper::OAggregationArrayUsageHelper< ORadioButtonModel > +{ + ::rtl::OUString m_sReferenceValue; // Referenzwert zum Checken des Buttons + sal_Int16 m_nDefaultChecked; // Soll beim Reset gecheckt werden ? + + sal_Bool m_bInReset : 1; + +protected: + virtual ::com::sun::star::uno::Any _getControlValue() const; + +public: + DECLARE_DEFAULT_LEAF_XTOR( ORadioButtonModel ); + + // XServiceInfo + IMPLEMENTATION_NAME(ORadioButtonModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // OPropertySetHelper + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // OPropertyChangeListener + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException); + + // XReset + virtual void SAL_CALL reset() throw(::com::sun::star::uno::RuntimeException); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + void SetSiblingPropsTo(const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rValue); + + void implConstruct(); + DECLARE_XCLONEABLE( ); +}; + +//================================================================== +// ORadioButtonControl +//================================================================== +class ORadioButtonControl: public OBoundControl +{ +public: + ORadioButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + + // XServiceInfo + IMPLEMENTATION_NAME(ORadioButtonControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +protected: + // XControl + virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference& Toolkit, const ::com::sun::star::uno::Reference& Parent) throw (::com::sun::star::uno::RuntimeException); +}; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_RADIOBUTTON_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/Time.hxx b/bf_forms/source/component/Time.hxx new file mode 100644 index 00000000000..98a31b0fda4 --- /dev/null +++ b/bf_forms/source/component/Time.hxx @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FORMS_TIME_HXX_ +#define _FORMS_TIME_HXX_ + +#include "EditBase.hxx" +#include "limitedformats.hxx" +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +//= OTimeModel +//================================================================== +class OTimeModel + :public OEditBaseModel + ,public OLimitedFormats + ,public ::comphelper::OAggregationArrayUsageHelper< OTimeModel > +{ + ::com::sun::star::uno::Any m_aSaveValue; + sal_Bool m_bDateTimeField; + static sal_Int32 nTimeHandle; + +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + DECLARE_DEFAULT_LEAF_XTOR( OTimeModel ); + + // stario::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XPropertySet + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OTimeModel); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); + + // ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // OAggregationArrayUsageHelper + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; + + using OPropertySetHelper::getFastPropertyValue; + + IMPLEMENT_INFO_SERVICE() + +protected: + DECLARE_XCLONEABLE(); +}; + +//================================================================== +//= OTimeControl +//================================================================== +class OTimeControl: public OBoundControl +{ +protected: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + +public: + OTimeControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + DECLARE_UNO3_AGG_DEFAULTS(OTimeControl, OBoundControl); + + // ::com::sun::star::lang::XServiceInfo + IMPLEMENTATION_NAME(OTimeControl); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); +}; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_TIME_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/cloneable.hxx b/bf_forms/source/component/cloneable.hxx new file mode 100644 index 00000000000..20d437084d4 --- /dev/null +++ b/bf_forms/source/component/cloneable.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef FORMS_COMPONENT_CLONEABLE_HXX +#define FORMS_COMPONENT_CLONEABLE_HXX + +#include +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + + //==================================================================== + //= OCloneableAggregation + //==================================================================== + class OCloneableAggregation + { + protected: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> m_xAggregate; + + protected: + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > createAggregateClone( const OCloneableAggregation* _pOriginal ); + }; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // FORMS_COMPONENT_CLONEABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/errorbroadcaster.hxx b/bf_forms/source/component/errorbroadcaster.hxx new file mode 100644 index 00000000000..d75f44f1187 --- /dev/null +++ b/bf_forms/source/component/errorbroadcaster.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef FORMS_ERRORBROADCASTER_HXX +#define FORMS_ERRORBROADCASTER_HXX + +#include +#include +#include +#include +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + + //===================================================================== + //= OErrorBroadcaster + //===================================================================== + typedef ::cppu::ImplHelper1 < ::com::sun::star::sdb::XSQLErrorBroadcaster + > OErrorBroadcaster_BASE; + + class OErrorBroadcaster : public OErrorBroadcaster_BASE + { + private: + ::cppu::OBroadcastHelper& m_rBHelper; + ::cppu::OInterfaceContainerHelper m_aErrorListeners; + + protected: + OErrorBroadcaster( ::cppu::OBroadcastHelper& _rBHelper ); + ~OErrorBroadcaster( ); + + void SAL_CALL disposing(); + + void SAL_CALL onError( const ::com::sun::star::sdb::SQLErrorEvent& _rException ); + + protected: + // XSQLErrorBroadcaster + virtual void SAL_CALL addSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& _rListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& _rListener ) throw (::com::sun::star::uno::RuntimeException); + }; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // FORMS_ERRORBROADCASTER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/forms_Button.cxx b/bf_forms/source/component/forms_Button.cxx new file mode 100644 index 00000000000..65cf6653284 --- /dev/null +++ b/bf_forms/source/component/forms_Button.cxx @@ -0,0 +1,409 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "Button.hxx" +#include +#include +#include +#include "services.hxx" +#include +#include +#include "bf_so3/staticbaseurl.hxx" + +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::util; + +//================================================================== +//= OButtonModel +//================================================================== +DBG_NAME(OButtonModel) +//------------------------------------------------------------------ +InterfaceRef SAL_CALL OButtonModel_CreateInstance(const Reference& _rxFactory) +{ + return *(new OButtonModel(_rxFactory)); +} + +//------------------------------------------------------------------ +OButtonModel::OButtonModel(const Reference& _rxFactory) + :OImageModel(_rxFactory, VCL_CONTROLMODEL_COMMANDBUTTON, FRM_CONTROL_COMMANDBUTTON) + // use the old control name for compytibility reasons +{ + DBG_CTOR( OButtonModel, NULL ); + m_nClassId = FormComponentType::COMMANDBUTTON; +} + +//------------------------------------------------------------------ +OButtonModel::OButtonModel( const OButtonModel* _pOriginal, const Reference& _rxFactory ) + :OImageModel( _pOriginal, _rxFactory ) +{ + DBG_CTOR( OButtonModel, NULL ); + implInitializeImageURL(); +} + +//------------------------------------------------------------------------------ +OButtonModel::~OButtonModel() +{ + DBG_DTOR(OButtonModel, NULL); +} + +//------------------------------------------------------------------------------ +Reference SAL_CALL OButtonModel::getPropertySetInfo() throw( RuntimeException ) +{ + Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; +} + +//------------------------------------------------------------------------------ +void OButtonModel::fillProperties( + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const +{ + FRM_BEGIN_PROP_HELPER(8) + DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); + DECL_PROP1(BUTTONTYPE, FormButtonType, BOUND); + DECL_PROP1(DISPATCHURLINTERNAL, sal_Bool, BOUND); + DECL_PROP1(TARGET_URL, ::rtl::OUString, BOUND); + DECL_PROP1(TARGET_FRAME, ::rtl::OUString, BOUND); + DECL_PROP1(NAME, ::rtl::OUString, BOUND); + DECL_PROP1(TAG, ::rtl::OUString, BOUND); + DECL_PROP1(TABINDEX, sal_Int16, BOUND); + FRM_END_PROP_HELPER(); +} + +//------------------------------------------------------------------------------ +::cppu::IPropertyArrayHelper& OButtonModel::getInfoHelper() +{ + return *const_cast(this)->getArrayHelper(); +} + +//------------------------------------------------------------------------------ +IMPLEMENT_DEFAULT_CLONING( OButtonModel ) + +// XServiceInfo +//------------------------------------------------------------------------------ +StringSequence OButtonModel::getSupportedServiceNames() throw() +{ + StringSequence aSupported = OControlModel::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 1); + + ::rtl::OUString*pArray = aSupported.getArray(); + pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_COMMANDBUTTON; + return aSupported; +} + +//------------------------------------------------------------------------------ +::rtl::OUString OButtonModel::getServiceName() throw ( ::com::sun::star::uno::RuntimeException) +{ + return FRM_COMPONENT_COMMANDBUTTON; // old (non-sun) name for compatibility ! +} + +//------------------------------------------------------------------------------ +void OButtonModel::write(const Reference& _rxOutStream) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) +{ + OImageModel::write(_rxOutStream); + + _rxOutStream->writeShort(0x0003); // Version + + { + OStreamSection aSection( _rxOutStream.get() ); + // this will allow readers to skip unknown bytes in their dtor + + _rxOutStream->writeShort( (sal_uInt16)m_eButtonType ); + + ::rtl::OUString sTmp = INetURLObject::decode(::binfilter::StaticBaseUrl::AbsToRel( m_sTargetURL ), '%', INetURLObject::DECODE_UNAMBIGUOUS); + _rxOutStream << sTmp; + _rxOutStream << m_sTargetFrame; + writeHelpTextCompatibly(_rxOutStream); + _rxOutStream << isDispatchUrlInternal(); + } +} + +//------------------------------------------------------------------------------ +void OButtonModel::read(const Reference& _rxInStream) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) +{ + OImageModel::read(_rxInStream); + + sal_uInt16 nVersion = _rxInStream->readShort(); // Version + switch (nVersion) + { + case 0x0001: + { + m_eButtonType = (FormButtonType)_rxInStream->readShort(); + + ::rtl::OUString sTmp; + _rxInStream >> sTmp; + m_sTargetURL = ::binfilter::StaticBaseUrl::RelToAbs( sTmp ); + _rxInStream >> m_sTargetFrame; + } + break; + + case 0x0002: + { + m_eButtonType = (FormButtonType)_rxInStream->readShort(); + + ::rtl::OUString sTmp; + _rxInStream >> sTmp; + m_sTargetURL = ::binfilter::StaticBaseUrl::RelToAbs( sTmp ); + _rxInStream >> m_sTargetFrame; + readHelpTextCompatibly(_rxInStream); + } + break; + + case 0x0003: + { + OStreamSection aSection( _rxInStream.get() ); + // this will skip any unknown bytes in it's dtor + + // button type + m_eButtonType = (FormButtonType)_rxInStream->readShort(); + + // URL + ::rtl::OUString sTmp; + _rxInStream >> sTmp; + m_sTargetURL = ::binfilter::StaticBaseUrl::RelToAbs( sTmp ); + + // target frame + _rxInStream >> m_sTargetFrame; + + // help text + readHelpTextCompatibly(_rxInStream); + + // DispatchInternal + sal_Bool bDispath; + _rxInStream >> bDispath; + setDispatchUrlInternal(bDispath); + } + break; + + default: + OSL_FAIL("OButtonModel::read : unknown version !"); + m_eButtonType = FormButtonType_PUSH; + m_sTargetURL = ::rtl::OUString(); + m_sTargetFrame = ::rtl::OUString(); + break; + } +} + +//================================================================== +// OButtonControl +//================================================================== +//------------------------------------------------------------------ +InterfaceRef SAL_CALL OButtonControl_CreateInstance(const Reference& _rxFactory) +{ + return *(new OButtonControl(_rxFactory)); +} + +//------------------------------------------------------------------------------ +Sequence OButtonControl::_getTypes() +{ + return ::comphelper::concatSequences( + OButtonControl_BASE::getTypes(), OImageControl::_getTypes() + ); +} + +//------------------------------------------------------------------------------ +StringSequence OButtonControl::getSupportedServiceNames() throw() +{ + StringSequence aSupported = OControl::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 1); + + ::rtl::OUString*pArray = aSupported.getArray(); + pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_COMMANDBUTTON; + return aSupported; +} + +//------------------------------------------------------------------------------ +OButtonControl::OButtonControl(const Reference& _rxFactory) + :OImageControl(_rxFactory, VCL_CONTROL_COMMANDBUTTON) + ,nClickEvent(0) +{ + increment(m_refCount); + { + // als ActionListener anmelden + Reference xButton; + query_aggregation( m_xAggregate, xButton); + if (xButton.is()) + xButton->addActionListener(this); + } + // Refcount bei 1 fuer Listener + /*sal_Int32 n =*/ decrement(m_refCount); +} + +//------------------------------------------------------------------------------ +OButtonControl::~OButtonControl() +{ + if (nClickEvent) + Application::RemoveUserEvent(nClickEvent); +} + +// UNO Anbindung +//------------------------------------------------------------------------------ +Any SAL_CALL OButtonControl::queryAggregation(const Type& _rType) throw (RuntimeException) +{ + // if asked for the XTypeProvider, don't let OButtonControl_BASE do this + Any aReturn; + if ( !_rType.equals( ::getCppuType( static_cast< Reference< XTypeProvider >* >( NULL ) ) ) ) + aReturn = OButtonControl_BASE::queryInterface( _rType ); + + if ( !aReturn.hasValue() ) + aReturn = OImageControl::queryAggregation( _rType ); + + return aReturn; +} + +// ActionListener +//------------------------------------------------------------------------------ +void OButtonControl::actionPerformed(const ActionEvent& /*rEvent*/) throw ( ::com::sun::star::uno::RuntimeException) +{ + // Asynchron fuer starutil::URL-Button + sal_uInt32 n = Application::PostUserEvent( LINK(this, OButtonControl,OnClick) ); + { + ::osl::MutexGuard aGuard( m_aMutex ); + nClickEvent = n; + } +} + +//------------------------------------------------------------------------------ +IMPL_LINK( OButtonControl, OnClick, void*, EMPTYARG ) +{ + ::osl::ClearableMutexGuard aGuard( m_aMutex ); + nClickEvent = 0; + + if (m_aApproveActionListeners.getLength()) + { + // Wenn es ApproveAction-Lisener gibt, muss ein eigener Thread + // aufgemacht werden. + if( !m_pThread ) + { + m_pThread = new OImageControlThread_Impl( this ); + m_pThread->acquire(); + m_pThread->create(); + } + m_pThread->addEvent(); + } + else + { + // Sonst nicht. Dann darf man aber auf keinen Fal die Listener + // benachrichtigen, auch dann nicht, wenn er spaeter hinzukommt. + aGuard.clear(); + + // recognize the button type + Reference xSet(getModel(), UNO_QUERY); + if (!xSet.is()) + return 0L; + + if (FormButtonType_PUSH == *(FormButtonType*)xSet->getPropertyValue(PROPERTY_BUTTONTYPE).getValue()) + { + // notify the action listeners for a push button + ::cppu::OInterfaceIteratorHelper aIter(m_aActionListeners); + ActionEvent aEvt(static_cast(this), m_aActionCommand); + while(aIter.hasMoreElements() ) + { + // catch exceptions + // and catch them on a per-listener basis - if one listener fails, the others still need + // to get notified + try + { + static_cast< XActionListener* >( aIter.next() )->actionPerformed(aEvt); + } +#ifdef DBG_UTIL + catch( const RuntimeException& ) + { + // silent this + } +#endif + catch( const Exception& ) + { + OSL_FAIL( "OButtonControl::OnClick: caught a exception other than RuntimeException!" ); + } + } + } + else + actionPerformed_Impl( sal_False ); + } + return 0L; +} + +// XButton +//------------------------------------------------------------------------------ +void OButtonControl::setLabel(const ::rtl::OUString& Label) throw( RuntimeException ) +{ + Reference xButton; + query_aggregation( m_xAggregate, xButton ); + if (xButton.is()) + xButton->setLabel(Label); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OButtonControl::setActionCommand(const ::rtl::OUString& _rCommand) throw( RuntimeException ) +{ + { + ::osl::MutexGuard aGuard( m_aMutex ); + m_aActionCommand = _rCommand; + } + + Reference xButton; + query_aggregation( m_xAggregate, xButton); + if (xButton.is()) + xButton->setActionCommand(_rCommand); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OButtonControl::addActionListener(const Reference& _rxListener) throw( RuntimeException ) +{ + m_aActionListeners.addInterface(_rxListener); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OButtonControl::removeActionListener(const Reference& _rxListener) throw( RuntimeException ) +{ + m_aActionListeners.removeInterface(_rxListener); +} + +//......................................................................... +} // namespace frm +//......................................................................... + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/forms_CheckBox.cxx b/bf_forms/source/component/forms_CheckBox.cxx new file mode 100644 index 00000000000..d4db2617690 --- /dev/null +++ b/bf_forms/source/component/forms_CheckBox.cxx @@ -0,0 +1,353 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "CheckBox.hxx" +#include "property.hrc" +#include "services.hxx" + +#include +#include +#include + +namespace binfilter { + +//......................................................................... +namespace frm +{ +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::util; + +//================================================================== +//= OCheckBoxControl +//================================================================== + +//------------------------------------------------------------------ +OCheckBoxControl::OCheckBoxControl(const Reference& _rxFactory) + :OBoundControl(_rxFactory, VCL_CONTROL_CHECKBOX) +{ +} + +//------------------------------------------------------------------ +InterfaceRef SAL_CALL OCheckBoxControl_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) +{ + return *(new OCheckBoxControl(_rxFactory)); +} + +//------------------------------------------------------------------------------ +StringSequence SAL_CALL OCheckBoxControl::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +{ + StringSequence aSupported = OBoundControl::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 1); + + ::rtl::OUString* pArray = aSupported.getArray(); + pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_CHECKBOX; + return aSupported; +} + +//================================================================== +//= OCheckBoxModel +//================================================================== + +//================================================================== +InterfaceRef SAL_CALL OCheckBoxModel_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) +{ + return *(new OCheckBoxModel(_rxFactory)); +} + +//------------------------------------------------------------------ +DBG_NAME( OCheckBoxModel ) +//------------------------------------------------------------------ +OCheckBoxModel::OCheckBoxModel(const Reference& _rxFactory) + :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_CHECKBOX, FRM_CONTROL_CHECKBOX, sal_False, sal_False) + // use the old control name for compytibility reasons + ,OPropertyChangeListener(m_aMutex) + ,m_bInReset(sal_False) + ,m_pAggregatePropertyMultiplexer(NULL) +{ + DBG_CTOR( OCheckBoxModel, NULL ); + implConstruct(); + + m_nClassId = FormComponentType::CHECKBOX; + m_nDefaultChecked = CB_NOCHECK; + m_sDataFieldConnectivityProperty = PROPERTY_STATE; +} + +//------------------------------------------------------------------ +OCheckBoxModel::OCheckBoxModel( const OCheckBoxModel* _pOriginal, const Reference& _rxFactory ) + :OBoundControlModel( _pOriginal, _rxFactory, sal_False, sal_False ) + ,OPropertyChangeListener( m_aMutex ) + ,m_bInReset( sal_False ) + ,m_pAggregatePropertyMultiplexer( NULL ) +{ + DBG_CTOR( OCheckBoxModel, NULL ); + implConstruct(); + + m_nDefaultChecked = _pOriginal->m_nDefaultChecked; + m_sReferenceValue = _pOriginal->m_sReferenceValue; +} + +//------------------------------------------------------------------------------ +void OCheckBoxModel::implConstruct() +{ + increment( m_refCount ); + if ( m_xAggregateSet.is() ) + { + m_pAggregatePropertyMultiplexer = new OPropertyChangeMultiplexer( this, m_xAggregateSet, sal_False ); + m_pAggregatePropertyMultiplexer->acquire(); + m_pAggregatePropertyMultiplexer->addProperty( PROPERTY_STATE ); + } + decrement( m_refCount ); + + doSetDelegator(); +} + +//------------------------------------------------------------------------------ +OCheckBoxModel::~OCheckBoxModel() +{ + doResetDelegator(); + + if (m_pAggregatePropertyMultiplexer) + { + m_pAggregatePropertyMultiplexer->dispose(); + m_pAggregatePropertyMultiplexer->release(); + m_pAggregatePropertyMultiplexer = NULL; + } + DBG_DTOR( OCheckBoxModel, NULL ); +} + +//------------------------------------------------------------------------------ +IMPLEMENT_DEFAULT_CLONING( OCheckBoxModel ) + +//------------------------------------------------------------------------------ +void SAL_CALL OCheckBoxModel::disposing() +{ + if (m_pAggregatePropertyMultiplexer) + m_pAggregatePropertyMultiplexer->dispose(); + + OBoundControlModel::disposing(); +} + +//------------------------------------------------------------------------------ +void OCheckBoxModel::_propertyChanged(const PropertyChangeEvent& /*rEvent*/) throw(RuntimeException) +{ + OSL_ENSURE( false, "OCheckBoxModel::_propertyChanged: dead code!?" ); +} + + +// XServiceInfo +//------------------------------------------------------------------------------ +StringSequence SAL_CALL OCheckBoxModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +{ + StringSequence aSupported = OBoundControlModel::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 2); + + ::rtl::OUString* pArray = aSupported.getArray(); + pArray[aSupported.getLength()-2] = FRM_SUN_COMPONENT_DATABASE_CHECKBOX; + pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_CHECKBOX; + return aSupported; +} + +//------------------------------------------------------------------------------ +void OCheckBoxModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const +{ + switch (_nHandle) + { + case PROPERTY_ID_REFVALUE: _rValue <<= m_sReferenceValue; break; + case PROPERTY_ID_DEFAULTCHECKED : _rValue <<= m_nDefaultChecked; break; + default: + OBoundControlModel::getFastPropertyValue(_rValue, _nHandle); + } +} + +//------------------------------------------------------------------------------ +void OCheckBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) throw (com::sun::star::uno::Exception) +{ + switch (_nHandle) + { + case PROPERTY_ID_REFVALUE : + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, "OCheckBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + _rValue >>= m_sReferenceValue; + break; + + case PROPERTY_ID_DEFAULTCHECKED : + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_SHORT, "OCheckBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + _rValue >>= m_nDefaultChecked; + //_reset(); + break; + + default: + OBoundControlModel::setFastPropertyValue_NoBroadcast(_nHandle, _rValue); + } +} + +//------------------------------------------------------------------------------ +sal_Bool OCheckBoxModel::convertFastPropertyValue( + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) + throw (IllegalArgumentException) +{ + sal_Bool bModified(sal_False); + switch (_nHandle) + { + case PROPERTY_ID_REFVALUE : + bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_sReferenceValue); + break; + case PROPERTY_ID_DEFAULTCHECKED : + bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_nDefaultChecked); + break; + default: + bModified = OBoundControlModel::convertFastPropertyValue(_rConvertedValue, _rOldValue, _nHandle, _rValue); + break; + } + return bModified; +} + +//------------------------------------------------------------------------------ +Reference SAL_CALL OCheckBoxModel::getPropertySetInfo() throw(RuntimeException) +{ + Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; +} + +//------------------------------------------------------------------------------ +cppu::IPropertyArrayHelper& OCheckBoxModel::getInfoHelper() +{ + return *const_cast(this)->getArrayHelper(); +} + +//------------------------------------------------------------------------------ +void OCheckBoxModel::fillProperties( + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const +{ + FRM_BEGIN_PROP_HELPER(10) + // the "State" property is transient, so change this +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_STATE, PropertyAttribute::TRANSIENT, 0); + + DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); + DECL_PROP1(REFVALUE, ::rtl::OUString, BOUND); + DECL_PROP1(DEFAULTCHECKED, sal_Int16, BOUND); + DECL_PROP1(NAME, rtl::OUString, BOUND); + DECL_PROP1(TAG, rtl::OUString, BOUND); + DECL_PROP1(TABINDEX, sal_Int16, BOUND); + DECL_PROP1(CONTROLSOURCE, rtl::OUString, BOUND); + DECL_IFACE_PROP3(BOUNDFIELD, XPropertySet, BOUND,READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); + DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); + FRM_END_PROP_HELPER(); +} + +//------------------------------------------------------------------------------ +::rtl::OUString SAL_CALL OCheckBoxModel::getServiceName() throw(RuntimeException) +{ + return FRM_COMPONENT_CHECKBOX; // old (non-sun) name for compatibility ! +} + +//------------------------------------------------------------------------------ +void SAL_CALL OCheckBoxModel::write(const Reference& _rxOutStream) + throw(stario::IOException, RuntimeException) +{ + OBoundControlModel::write(_rxOutStream); + + // Version + _rxOutStream->writeShort(0x0003); + // Properties + _rxOutStream << m_sReferenceValue; + _rxOutStream << (sal_Int16)m_nDefaultChecked; + writeHelpTextCompatibly(_rxOutStream); + // from version 0x0003 : common properties + writeCommonProperties(_rxOutStream); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OCheckBoxModel::read(const Reference& _rxInStream) throw(stario::IOException, RuntimeException) +{ + OBoundControlModel::read(_rxInStream); + osl::MutexGuard aGuard(m_aMutex); + + // Version + sal_uInt16 nVersion = _rxInStream->readShort(); + + switch (nVersion) + { + case 0x0001 : _rxInStream >> m_sReferenceValue; m_nDefaultChecked = _rxInStream->readShort(); break; + case 0x0002 : + _rxInStream >> m_sReferenceValue; + _rxInStream >> m_nDefaultChecked; + readHelpTextCompatibly(_rxInStream); + break; + case 0x0003 : + _rxInStream >> m_sReferenceValue; + _rxInStream >> m_nDefaultChecked; + readHelpTextCompatibly(_rxInStream); + readCommonProperties(_rxInStream); + break; + default : + OSL_FAIL("OCheckBoxModel::read : unknown version !"); + m_sReferenceValue = ::rtl::OUString(); + m_nDefaultChecked = 0; + defaultCommonProperties(); + break; + } + +// // Nach dem Lesen die Defaultwerte anzeigen +// if (m_aControlSource.getLength()) +// // (not if we don't have a control source - the "State" property acts like it is persistent, then +// _reset(); +} + +//------------------------------------------------------------------------------ +Any OCheckBoxModel::_getControlValue() const +{ + return m_xAggregateSet->getPropertyValue(PROPERTY_STATE); +} + +//----------------------------------------------------------------------------- +void OCheckBoxModel::reset(void) throw (com::sun::star::uno::RuntimeException) +{ + m_bInReset = sal_True; + OBoundControlModel::reset(); + m_bInReset = sal_False; +} + +//......................................................................... +} +//......................................................................... + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/forms_Columns.cxx b/bf_forms/source/component/forms_Columns.cxx new file mode 100644 index 00000000000..51d2a89f828 --- /dev/null +++ b/bf_forms/source/component/forms_Columns.cxx @@ -0,0 +1,629 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "Columns.hxx" +#include "property.hrc" +#include "property.hxx" +#include "ids.hxx" + +#include +#include +#include +#include +#include + +#include "services.hxx" +#include "frm_resource.hrc" +#include +#include + +#include + +namespace binfilter { + +namespace internal { +sal_Int32 findPos(const ::rtl::OUString& aStr, const StringSequence& rList); +} + +//......................................................................... +namespace frm +{ +//......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; + +const sal_uInt16 WIDTH = 0x0001; +const sal_uInt16 ALIGN = 0x0002; +const sal_uInt16 OLD_HIDDEN = 0x0004; +const sal_uInt16 COMPATIBLE_HIDDEN = 0x0008; + +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_TEXTFIELD, "TextField"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_COMBOBOX, "ComboBox"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_CHECKBOX, "CheckBox"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_TIMEFIELD, "TimeField"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_DATEFIELD, "DateField"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_NUMERICFIELD, "NumericField"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_CURRENCYFIELD, "CurrencyField"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_PATTERNFIELD, "PatternField"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_LISTBOX, "ListBox"); +IMPLEMENT_CONSTASCII_USTRING(FRM_COL_FORMATTEDFIELD, "FormattedField"); + +//------------------------------------------------------------------------------ +const StringSequence& getColumnTypes() +{ + static StringSequence aColumnTypes(10); + if (!aColumnTypes.getConstArray()[0].getLength()) + { + ::rtl::OUString* pNames = aColumnTypes.getArray(); + pNames[TYPE_CHECKBOX] = FRM_COL_CHECKBOX; + pNames[TYPE_COMBOBOX] = FRM_COL_COMBOBOX; + pNames[TYPE_CURRENCYFIELD] = FRM_COL_CURRENCYFIELD; + pNames[TYPE_DATEFIELD] = FRM_COL_DATEFIELD; + pNames[TYPE_FORMATTEDFIELD] = FRM_COL_FORMATTEDFIELD; + pNames[TYPE_LISTBOX] = FRM_COL_LISTBOX; + pNames[TYPE_NUMERICFIELD] = FRM_COL_NUMERICFIELD; + pNames[TYPE_PATTERNFIELD] = FRM_COL_PATTERNFIELD; + pNames[TYPE_TEXTFIELD] = FRM_COL_TEXTFIELD; + pNames[TYPE_TIMEFIELD] = FRM_COL_TIMEFIELD; + } + return aColumnTypes; +} + +//------------------------------------------------------------------------------ +sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName) +{ + const ::rtl::OUString aModelPrefix( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component." )); + const ::rtl::OUString aCompatibleModelPrefix( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component." )); + + sal_Int32 nTypeId = -1; + if (aModelName == FRM_COMPONENT_EDIT) + nTypeId = TYPE_TEXTFIELD; + else + { + sal_Int32 nPrefixPos = aModelName.indexOf(aModelPrefix); + sal_Int32 nCompatiblePrefixPos = aModelName.indexOf(aCompatibleModelPrefix); + DBG_ASSERT( (nPrefixPos != -1) || (nCompatiblePrefixPos != -1), + "::getColumnTypeByModelName() : wrong servivce !"); + (void)nCompatiblePrefixPos; + + ::rtl::OUString aColumnType = (nPrefixPos != -1) + ? aModelName.copy(aModelPrefix.getLength()) + : aModelName.copy(aCompatibleModelPrefix.getLength()); + + const StringSequence& rColumnTypes = getColumnTypes(); + nTypeId = ::binfilter::internal::findPos(aColumnType, rColumnTypes); + } + return nTypeId; +} + +/*************************************************************************/ + +//------------------------------------------------------------------ +const Sequence& OGridColumn::getUnoTunnelImplementationId() +{ + static Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +//------------------------------------------------------------------ +sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence& _rIdentifier) throw(RuntimeException) +{ + sal_Int64 nReturn(0); + + if ( (_rIdentifier.getLength() == 16) + && (0 == rtl_compareMemory( getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 )) + ) + { + nReturn = reinterpret_cast(this); + } + else + { + Reference xAggregateTunnel(m_xAggregate, UNO_QUERY); + if (xAggregateTunnel.is()) + nReturn = xAggregateTunnel->getSomething(_rIdentifier); + } + return nReturn; +} + +//------------------------------------------------------------------ +Sequence SAL_CALL OGridColumn::getImplementationId() throw(RuntimeException) +{ + return OImplementationIds::getImplementationId(getTypes()); +} + +//------------------------------------------------------------------ +Sequence SAL_CALL OGridColumn::getTypes() throw(RuntimeException) +{ + Reference xProv; + + if (query_aggregation(m_xAggregate, xProv)) + return concatSequences(OGridColumn_BASE::getTypes(), xProv->getTypes()); + return OGridColumn_BASE::getTypes(); +} + +//------------------------------------------------------------------ +Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType ) throw (RuntimeException) +{ + Any aReturn; + // though our aggregate may be an XFormComponent or an XServiceInfo, we aren't anymore + if ( _rType.equals(::getCppuType(static_cast< Reference< XFormComponent >* >(NULL))) + || _rType.equals(::getCppuType(static_cast< Reference< XServiceInfo >* >(NULL))) + ) + return aReturn; + + aReturn = OGridColumn_BASE::queryAggregation(_rType); + if (!aReturn.hasValue()) + { + aReturn = OPropertySetAggregationHelper::queryInterface(_rType); + if (!aReturn.hasValue() && m_xAggregate.is()) + aReturn = m_xAggregate->queryAggregation(_rType); + } + + return aReturn; +} + +DBG_NAME(OGridColumn) +//------------------------------------------------------------------------------ +OGridColumn::OGridColumn(const Reference& _rxFactory, const ::rtl::OUString& _sModelName) + :OGridColumn_BASE(m_aMutex) + ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper) + ,m_aHidden( makeAny( sal_False ) ) + ,m_aModelName(_sModelName) +{ + DBG_CTOR(OGridColumn,NULL); + + // Anlegen des UnoControlModels + if ( m_aModelName.getLength() ) // is there a to-be-aggregated model? + { + increment( m_refCount ); + + // Muss im eigenen Block, + // da xAgg vor dem delegator setzen wieder freigesetzt sein mus ! + { + m_xAggregate = Reference< XAggregation >( _rxFactory->createInstance( m_aModelName ), UNO_QUERY ); + setAggregation( m_xAggregate ); + } + + if (m_xAggregate.is()) + { // don't omit this brackets - they ensure that the following temporary is properly deleted + m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) ); + } + + // Refcount wieder bei NULL + decrement( m_refCount ); + } + + if ( m_xAggregateSet.is() ) + { + Reference< XPropertySetInfo > xPropInfo = m_xAggregateSet->getPropertySetInfo(); + if ( xPropInfo.is() && xPropInfo->hasPropertyByName( PROPERTY_TRISTATE ) ) + m_xAggregateSet->setPropertyValue( PROPERTY_TRISTATE, makeAny( sal_True ) ); + } +} + +//------------------------------------------------------------------------------ +OGridColumn::~OGridColumn() +{ + if (!OGridColumn_BASE::rBHelper.bDisposed) + { + acquire(); + dispose(); + } + + // freigeben der Agg + if (m_xAggregate.is()) + { + InterfaceRef xIface; + m_xAggregate->setDelegator(xIface); + } + + DBG_DTOR(OGridColumn,NULL); +} + +// XCloneable +//------------------------------------------------------------------------------ +//IMPLEMENT_DEFAULT_CLONING( OGridColumn ) + +// XChild +//------------------------------------------------------------------------------ +void SAL_CALL OGridColumn::setParent(const InterfaceRef& Parent) throw(NoSupportException, RuntimeException) +{ + m_xParent = Parent; +} + +// XEventListener +//------------------------------------------------------------------------------ +void SAL_CALL OGridColumn::disposing(const EventObject& _rSource) throw(RuntimeException) +{ + OPropertySetAggregationHelper::disposing(_rSource); + + Reference xEvtLstner; + if (query_aggregation(m_xAggregate, xEvtLstner)) + xEvtLstner->disposing(_rSource); +} + +// OGridColumn_BASE +//----------------------------------------------------------------------------- +void OGridColumn::disposing() +{ + OGridColumn_BASE::disposing(); + OPropertySetAggregationHelper::disposing(); + + Reference xComp; + if (query_aggregation(m_xAggregate, xComp)) + xComp->dispose(); + + setParent(InterfaceRef ()); +} + +//------------------------------------------------------------------------------ +void OGridColumn::clearAggregateProperties(Sequence& seqProps, sal_Bool bAllowDropDown) +{ + RemoveProperty(seqProps, PROPERTY_ALIGN); + RemoveProperty(seqProps, PROPERTY_AUTOCOMPLETE); + RemoveProperty(seqProps, PROPERTY_BACKGROUNDCOLOR); + RemoveProperty(seqProps, PROPERTY_BORDER); + if (!bAllowDropDown) + RemoveProperty(seqProps, PROPERTY_DROPDOWN); + RemoveProperty(seqProps, PROPERTY_ECHO_CHAR); + RemoveProperty(seqProps, PROPERTY_FILLCOLOR); + RemoveProperty(seqProps, PROPERTY_FONT); + RemoveProperty(seqProps, PROPERTY_FONT_NAME); + RemoveProperty(seqProps, PROPERTY_FONT_STYLENAME); + RemoveProperty(seqProps, PROPERTY_FONT_FAMILY); + RemoveProperty(seqProps, PROPERTY_FONT_CHARSET); + RemoveProperty(seqProps, PROPERTY_FONT_HEIGHT); + RemoveProperty(seqProps, PROPERTY_FONT_WEIGHT); + RemoveProperty(seqProps, PROPERTY_FONT_SLANT); + RemoveProperty(seqProps, PROPERTY_FONT_UNDERLINE); + RemoveProperty(seqProps, PROPERTY_FONT_STRIKEOUT); + RemoveProperty(seqProps, PROPERTY_FONT_WORDLINEMODE); + RemoveProperty(seqProps, PROPERTY_TEXTLINECOLOR); + RemoveProperty(seqProps, PROPERTY_FONTEMPHASISMARK); + RemoveProperty(seqProps, PROPERTY_FONTRELIEF); + RemoveProperty(seqProps, PROPERTY_HARDLINEBREAKS); + RemoveProperty(seqProps, PROPERTY_HSCROLL); + RemoveProperty(seqProps, PROPERTY_LABEL); + RemoveProperty(seqProps, PROPERTY_LINECOLOR); + RemoveProperty(seqProps, PROPERTY_MULTI); + RemoveProperty(seqProps, PROPERTY_MULTILINE); + RemoveProperty(seqProps, PROPERTY_MULTISELECTION); + RemoveProperty(seqProps, PROPERTY_PRINTABLE); + RemoveProperty(seqProps, PROPERTY_TABINDEX); + RemoveProperty(seqProps, PROPERTY_TABSTOP); + RemoveProperty(seqProps, PROPERTY_TEXTCOLOR); + RemoveProperty(seqProps, PROPERTY_TRISTATE); + RemoveProperty(seqProps, PROPERTY_VSCROLL); + RemoveProperty(seqProps, PROPERTY_CONTROLLABEL); +} + +//------------------------------------------------------------------------------ +void OGridColumn::setOwnProperties(Sequence& aDescriptor) +{ + aDescriptor.realloc(5); + Property* pProps = aDescriptor.getArray(); + sal_Int32 nPos = 0; + DECL_PROP1(LABEL, ::rtl::OUString, BOUND); + DECL_PROP3(WIDTH, sal_Int32, BOUND, MAYBEVOID, MAYBEDEFAULT); + DECL_PROP3(ALIGN, sal_Int16, BOUND, MAYBEVOID, MAYBEDEFAULT); + DECL_BOOL_PROP2(HIDDEN, BOUND, MAYBEDEFAULT); + DECL_PROP1(COLUMNSERVICENAME, ::rtl::OUString, READONLY); +} + +// Reference +//------------------------------------------------------------------------------ +Reference SAL_CALL OGridColumn::getPropertySetInfo() throw(RuntimeException) +{ + OSL_FAIL("OGridColumn::getPropertySetInfo() : Dummy Called"); + return Reference (); +} + +//------------------------------------------------------------------------------ +::cppu::IPropertyArrayHelper& OGridColumn::getInfoHelper() +{ + OSL_FAIL("OGridColumn::getInfoHelper() : Dummy Called"); + + Sequence aDescriptor, aAggProperties; + static OPropertyArrayAggregationHelper aDescAry(aDescriptor, aAggProperties); + return aDescAry; +} + +//------------------------------------------------------------------------------ +void OGridColumn::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const +{ + switch (nHandle) + { + case PROPERTY_ID_COLUMNSERVICENAME: + rValue <<= m_aModelName; + break; + case PROPERTY_ID_LABEL: + rValue <<= m_aLabel; + break; + case PROPERTY_ID_WIDTH: + rValue = m_aWidth; + break; + case PROPERTY_ID_ALIGN: + rValue = m_aAlign; + break; + case PROPERTY_ID_HIDDEN: + rValue = m_aHidden; + break; + default: + OPropertySetAggregationHelper::getFastPropertyValue(rValue, nHandle); + } +} + +//------------------------------------------------------------------------------ +sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, + sal_Int32 nHandle, const Any& rValue )throw( IllegalArgumentException ) +{ + sal_Bool bModified(sal_False); + switch (nHandle) + { + case PROPERTY_ID_LABEL: + bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aLabel); + break; + case PROPERTY_ID_WIDTH: + bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, ::getCppuType((const sal_Int32*)NULL)); + break; + case PROPERTY_ID_ALIGN: + try + { + bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aAlign, ::getCppuType((const sal_Int16*)NULL)); + } + catch(starlang::IllegalArgumentException&) + { + OSL_FAIL("OGridColumn::convertFastPropertyValue: TextAlign must be casted to sal_Int16!"); + throw; + } + break; + case PROPERTY_ID_HIDDEN: + bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, getBOOL(m_aHidden)); + break; + } + return bModified; +} + +//------------------------------------------------------------------------------ +void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (::com::sun::star::uno::Exception) +{ + switch (nHandle) + { + case PROPERTY_ID_LABEL: + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" ); + rValue >>= m_aLabel; + break; + case PROPERTY_ID_WIDTH: + m_aWidth = rValue; + break; + case PROPERTY_ID_ALIGN: + m_aAlign = rValue; + break; + case PROPERTY_ID_HIDDEN: + m_aHidden = rValue; + break; + } +} + + +// XPropertyState +//------------------------------------------------------------------------------ +PropertyState OGridColumn::getPropertyStateByHandle(sal_Int32 nHandle) +{ + PropertyState eState = PropertyState_DIRECT_VALUE; + + switch (nHandle) + { + case PROPERTY_ID_WIDTH: + if (!m_aWidth.hasValue()) + eState = PropertyState_DEFAULT_VALUE; + break; + + case PROPERTY_ID_ALIGN: + if (!m_aAlign.hasValue()) + eState = PropertyState_DEFAULT_VALUE; + break; + + case PROPERTY_ID_HIDDEN: + { + sal_Bool bHidden = sal_True; + if ( ( m_aHidden >>= bHidden ) && !bHidden ) + eState = PropertyState_DEFAULT_VALUE; + } + break; + + default: + eState = OPropertySetAggregationHelper::getPropertyStateByHandle(nHandle); + } + return eState; +} + +//------------------------------------------------------------------------------ +void OGridColumn::setPropertyToDefaultByHandle(sal_Int32 nHandle) +{ + switch (nHandle) + { + case PROPERTY_ID_WIDTH: + case PROPERTY_ID_ALIGN: + setFastPropertyValue(nHandle, Any()); + break; + case PROPERTY_ID_HIDDEN: + setFastPropertyValue( nHandle, makeAny( (sal_Bool)sal_False ) ); + break; + default: + OPropertySetAggregationHelper::setPropertyToDefaultByHandle(nHandle); + } +} + +//------------------------------------------------------------------------------ +Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle ) const +{ + switch (nHandle) + { + case PROPERTY_ID_WIDTH: + case PROPERTY_ID_ALIGN: + return Any(); + case PROPERTY_ID_HIDDEN: + return makeAny((sal_Bool)sal_False); + default: + return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle); + } +} + +//XPersistObject +//------------------------------------------------------------------------------ +void SAL_CALL OGridColumn::write(const Reference& _rxOutStream) +{ + // 1. Schreiben des UnoControls + Reference xMark(_rxOutStream, UNO_QUERY); + sal_Int32 nMark = xMark->createMark(); + + sal_Int32 nLen = 0; + _rxOutStream->writeLong(nLen); + + Reference xPersist; + if (query_aggregation(m_xAggregate, xPersist)) + xPersist->write(_rxOutStream); + + // feststellen der Laenge + nLen = xMark->offsetToMark(nMark) - 4; + xMark->jumpToMark(nMark); + _rxOutStream->writeLong(nLen); + xMark->jumpToFurthest(); + xMark->deleteMark(nMark); + + // 2. Schreiben einer VersionsNummer + _rxOutStream->writeShort(0x0002); + + sal_uInt16 nAnyMask = 0; + if (m_aWidth.getValueType().getTypeClass() == TypeClass_LONG) + nAnyMask |= WIDTH; + + if (m_aAlign.getValueTypeClass() == TypeClass_SHORT) + nAnyMask |= ALIGN; + + nAnyMask |= COMPATIBLE_HIDDEN; + + _rxOutStream->writeShort(nAnyMask); + + if (nAnyMask & WIDTH) + _rxOutStream->writeLong(getINT32(m_aWidth)); + if (nAnyMask & ALIGN) + _rxOutStream->writeShort(getINT16(m_aAlign)); + + // Name + _rxOutStream << m_aLabel; + + // the new place for the hidden flag : after m_aLabel, so older office version read the correct label, too + if (nAnyMask & COMPATIBLE_HIDDEN) + _rxOutStream->writeBoolean(getBOOL(m_aHidden)); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OGridColumn::read(const Reference& _rxInStream) +{ + // 1. Lesen des UnoControls + sal_Int32 nLen = _rxInStream->readLong(); + if (nLen) + { + Reference xMark(_rxInStream, UNO_QUERY); + sal_Int32 nMark = xMark->createMark(); + Reference xPersist; + if (query_aggregation(m_xAggregate, xPersist)) + xPersist->read(_rxInStream); + + xMark->jumpToMark(nMark); + _rxInStream->skipBytes(nLen); + xMark->deleteMark(nMark); + } + + // 2. Lesen des Versionsnummer + /*sal_uInt16 nVersion =*/ _rxInStream->readShort(); + sal_uInt16 nAnyMask = _rxInStream->readShort(); + + if (nAnyMask & WIDTH) + { + sal_Int32 nValue = _rxInStream->readLong(); + m_aWidth <<= (sal_Int32)nValue; + } + + if (nAnyMask & ALIGN) + { + sal_Int16 nValue = _rxInStream->readShort(); + m_aAlign <<= nValue; + } + if (nAnyMask & OLD_HIDDEN) + { + sal_Bool bValue = _rxInStream->readBoolean(); + m_aHidden <<= (sal_Bool)bValue; + } + + // Name + _rxInStream >> m_aLabel; + + if (nAnyMask & COMPATIBLE_HIDDEN) + { + sal_Bool bValue = _rxInStream->readBoolean(); + m_aHidden <<= (sal_Bool)bValue; + } +} + +//------------------------------------------------------------------------------ +IMPL_COLUMN(TextFieldColumn, FRM_SUN_COMPONENT_TEXTFIELD, sal_False); +IMPL_COLUMN(PatternFieldColumn, FRM_SUN_COMPONENT_PATTERNFIELD, sal_False); +IMPL_COLUMN(DateFieldColumn, FRM_SUN_COMPONENT_DATEFIELD, sal_True); +IMPL_COLUMN(TimeFieldColumn, FRM_SUN_COMPONENT_TIMEFIELD, sal_False); +IMPL_COLUMN(NumericFieldColumn, FRM_SUN_COMPONENT_NUMERICFIELD, sal_False); +IMPL_COLUMN(CurrencyFieldColumn, FRM_SUN_COMPONENT_CURRENCYFIELD, sal_False); +IMPL_COLUMN(CheckBoxColumn, FRM_SUN_COMPONENT_CHECKBOX, sal_False); +IMPL_COLUMN(ComboBoxColumn, FRM_SUN_COMPONENT_COMBOBOX, sal_False); +IMPL_COLUMN(ListBoxColumn, FRM_SUN_COMPONENT_LISTBOX, sal_False); +IMPL_COLUMN(FormattedFieldColumn, FRM_SUN_COMPONENT_FORMATTEDFIELD, sal_False); + +//......................................................................... +} // namespace frm +//......................................................................... + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/forms_ComboBox.cxx b/bf_forms/source/component/forms_ComboBox.cxx new file mode 100644 index 00000000000..f5790bd1a53 --- /dev/null +++ b/bf_forms/source/component/forms_ComboBox.cxx @@ -0,0 +1,476 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "ComboBox.hxx" +#include "property.hrc" +#include "services.hxx" +#include "frm_resource.hxx" +#include "frm_resource.hrc" +#include "BaseListBox.hxx" +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include + +#include + +namespace binfilter { + + using namespace ::dbtools; + +//......................................................................... +namespace frm +{ +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::util; + +//======================================================================== +// class OComboBoxModel +//======================================================================== +sal_Int32 OComboBoxModel::nTextHandle = -1; + +//------------------------------------------------------------------ +InterfaceRef SAL_CALL OComboBoxModel_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) +{ + return (*new OComboBoxModel(_rxFactory)); +} + +//------------------------------------------------------------------------------ +Sequence OComboBoxModel::_getTypes() +{ + return ::comphelper::concatSequences( + OBoundControlModel::_getTypes(), + OErrorBroadcaster::getTypes() + ); +} + +// XServiceInfo +//------------------------------------------------------------------------------ +StringSequence SAL_CALL OComboBoxModel::getSupportedServiceNames() throw(RuntimeException) +{ + StringSequence aSupported = OBoundControlModel::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 2); + + ::rtl::OUString* pArray = aSupported.getArray(); + pArray[aSupported.getLength()-2] = FRM_SUN_COMPONENT_DATABASE_COMBOBOX; + pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_COMBOBOX; + return aSupported; +} + +//------------------------------------------------------------------------------ +Any SAL_CALL OComboBoxModel::queryAggregation(const Type& _rType) throw (RuntimeException) +{ + Any aReturn = OBoundControlModel::queryAggregation( _rType ); + return aReturn.hasValue() ? aReturn : OErrorBroadcaster::queryInterface( _rType ); +} + +//------------------------------------------------------------------ +DBG_NAME( OComboBoxModel ) +//------------------------------------------------------------------ +OComboBoxModel::OComboBoxModel(const Reference& _rxFactory) + :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_COMBOBOX, FRM_CONTROL_COMBOBOX) + // use the old control name for compytibility reasons + ,OErrorBroadcaster( OComponentHelper::rBHelper ) + ,m_eListSourceType(ListSourceType_TABLE) + ,m_aNullDate(DBTypeConversion::getStandardDate()) + ,m_nFormatKey(0) + ,m_nFieldType(DataType::OTHER) + ,m_nKeyType(NumberFormat::UNDEFINED) + ,m_bEmptyIsNull(sal_True) +{ + DBG_CTOR( OComboBoxModel, NULL ); + + m_nClassId = FormComponentType::COMBOBOX; + m_sDataFieldConnectivityProperty = PROPERTY_TEXT; + if (OComboBoxModel::nTextHandle == -1) + OComboBoxModel::nTextHandle = getOriginalHandle(PROPERTY_ID_TEXT); +} + +//------------------------------------------------------------------ +OComboBoxModel::OComboBoxModel( const OComboBoxModel* _pOriginal, const Reference& _rxFactory ) + :OBoundControlModel( _pOriginal, _rxFactory ) + ,OErrorBroadcaster( OComponentHelper::rBHelper ) + ,m_aNullDate(DBTypeConversion::getStandardDate()) + ,m_nFormatKey(0) + ,m_nFieldType(DataType::OTHER) + ,m_nKeyType(NumberFormat::UNDEFINED) +{ + DBG_CTOR( OComboBoxModel, NULL ); + + m_eListSourceType = _pOriginal->m_eListSourceType; + m_bEmptyIsNull = _pOriginal->m_bEmptyIsNull; + m_aListSource = _pOriginal->m_aListSource; + m_aDefaultText = _pOriginal->m_aDefaultText; +} + +//------------------------------------------------------------------ +OComboBoxModel::~OComboBoxModel() +{ + if (!OComponentHelper::rBHelper.bDisposed) + { + acquire(); + dispose(); + } + + DBG_DTOR( OComboBoxModel, NULL ); +} + +// XCloneable +//------------------------------------------------------------------------------ +IMPLEMENT_DEFAULT_CLONING( OComboBoxModel ) + +//------------------------------------------------------------------------------ +void OComboBoxModel::disposing() +{ + OBoundControlModel::disposing(); + OErrorBroadcaster::disposing(); + m_xFormatter = NULL; +} + +//------------------------------------------------------------------------------ +void OComboBoxModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const +{ + switch (_nHandle) + { + case PROPERTY_ID_LISTSOURCETYPE : _rValue <<= m_eListSourceType; break; + case PROPERTY_ID_LISTSOURCE : _rValue <<= m_aListSource; break; + case PROPERTY_ID_EMPTY_IS_NULL : _rValue <<= m_bEmptyIsNull; break; + case PROPERTY_ID_DEFAULT_TEXT : _rValue <<= m_aDefaultText; break; + default: + OBoundControlModel::getFastPropertyValue(_rValue, _nHandle); + } +} + +//------------------------------------------------------------------------------ +void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) + throw (Exception) +{ + switch (_nHandle) + { + case PROPERTY_ID_LISTSOURCETYPE : + DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast(NULL))), + "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + _rValue >>= m_eListSourceType; + break; + + case PROPERTY_ID_LISTSOURCE : + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, + "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + _rValue >>= m_aListSource; + // die ListSource hat sich geaendert -> neu laden + if (ListSourceType_VALUELIST != m_eListSourceType) + { + if (m_xCursor.is() && !getField().is()) // combobox bereits mit Datenbank verbunden ? + // neu laden + loadData(); + } + break; + + case PROPERTY_ID_EMPTY_IS_NULL : + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_BOOLEAN, + "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + _rValue >>= m_bEmptyIsNull; + break; + + case PROPERTY_ID_DEFAULT_TEXT : + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, + "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + _rValue >>= m_aDefaultText; + //_reset(); + break; + + default: + OBoundControlModel::setFastPropertyValue_NoBroadcast(_nHandle, _rValue); + } +} + +//------------------------------------------------------------------------------ +sal_Bool OComboBoxModel::convertFastPropertyValue( + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) + throw (IllegalArgumentException) +{ + sal_Bool bModified(sal_False); + switch (_nHandle) + { + case PROPERTY_ID_LISTSOURCETYPE : + bModified = tryPropertyValueEnum(_rConvertedValue, _rOldValue, _rValue, m_eListSourceType); + break; + + case PROPERTY_ID_LISTSOURCE : + bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_aListSource); + break; + + case PROPERTY_ID_EMPTY_IS_NULL : + bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_bEmptyIsNull); + break; + + case PROPERTY_ID_DEFAULT_TEXT : + bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_aDefaultText); + break; + + default: + bModified = OBoundControlModel::convertFastPropertyValue(_rConvertedValue, _rOldValue, _nHandle, _rValue); + break; + } + return bModified; +} + +//------------------------------------------------------------------------------ +Reference SAL_CALL OComboBoxModel::getPropertySetInfo() throw(RuntimeException) +{ + Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; +} + +//------------------------------------------------------------------------------ +cppu::IPropertyArrayHelper& OComboBoxModel::getInfoHelper() +{ + return *const_cast(this)->getArrayHelper(); +} + +//------------------------------------------------------------------------------ +void OComboBoxModel::fillProperties( + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const +{ + FRM_BEGIN_PROP_HELPER(12) + DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); + DECL_PROP1(NAME, ::rtl::OUString, BOUND); + DECL_PROP1(TAG, ::rtl::OUString, BOUND); + DECL_PROP1(TABINDEX, sal_Int16, BOUND); + DECL_PROP1(LISTSOURCETYPE, ListSourceType, BOUND); + DECL_PROP1(LISTSOURCE, ::rtl::OUString, BOUND); + DECL_BOOL_PROP1(EMPTY_IS_NULL, BOUND); + DECL_PROP1(DEFAULT_TEXT, ::rtl::OUString, BOUND); + DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); + DECL_IFACE_PROP3(BOUNDFIELD, XPropertySet, BOUND,READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); + DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); + FRM_END_PROP_HELPER(); +} + +//------------------------------------------------------------------------------ +::rtl::OUString SAL_CALL OComboBoxModel::getServiceName() throw(RuntimeException) +{ + return FRM_COMPONENT_COMBOBOX; // old (non-sun) name for compatibility ! +} + +//------------------------------------------------------------------------------ +void SAL_CALL OComboBoxModel::write(const Reference& _rxOutStream) + throw(stario::IOException, RuntimeException) +{ + OBoundControlModel::write(_rxOutStream); + + // Version + // Version 0x0002: EmptyIsNull + // Version 0x0003: ListSource->Seq + // Version 0x0004: DefaultText + // Version 0x0005: HelpText + _rxOutStream->writeShort(0x0006); + + // Maskierung fuer any + sal_uInt16 nAnyMask = 0; + if (m_aBoundColumn.getValueType().getTypeClass() == TypeClass_SHORT) + nAnyMask |= BOUNDCOLUMN; + _rxOutStream << nAnyMask; + + StringSequence aListSourceSeq(&m_aListSource, 1); + _rxOutStream << aListSourceSeq; + _rxOutStream << (sal_Int16)m_eListSourceType; + + if ((nAnyMask & BOUNDCOLUMN) == BOUNDCOLUMN) + { + sal_Int16 nBoundColumn(0); + m_aBoundColumn >>= nBoundColumn; + _rxOutStream << nBoundColumn; + } + + _rxOutStream << (sal_Bool)m_bEmptyIsNull; + _rxOutStream << m_aDefaultText; + writeHelpTextCompatibly(_rxOutStream); + + // from version 0x0006 : common properties + writeCommonProperties(_rxOutStream); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OComboBoxModel::read(const Reference& _rxInStream) throw(stario::IOException, RuntimeException) +{ + OBoundControlModel::read(_rxInStream); + ::osl::MutexGuard aGuard(m_aMutex); + + // Version + sal_uInt16 nVersion = _rxInStream->readShort(); + DBG_ASSERT(nVersion > 0, "OComboBoxModel::read : version 0 ? this should never have been written !"); + + if (nVersion > 0x0006) + { + OSL_FAIL("OComboBoxModel::read : invalid (means unknown) version !"); + m_aListSource = ::rtl::OUString(); + m_aBoundColumn <<= (sal_Int16)0; + m_aDefaultText = ::rtl::OUString(); + m_eListSourceType = ListSourceType_TABLE; + m_bEmptyIsNull = sal_True; + defaultCommonProperties(); + return; + } + + // Maskierung fuer any + sal_uInt16 nAnyMask; + _rxInStream >> nAnyMask; + + // ListSource + if (nVersion < 0x0003) + { + ::rtl::OUString sListSource; + _rxInStream >> m_aListSource; + } + else // nVersion == 4 + { + m_aListSource = ::rtl::OUString(); + StringSequence aListSource; + _rxInStream >> aListSource; + const ::rtl::OUString* pToken = aListSource.getConstArray(); + sal_Int32 nLen = aListSource.getLength(); + for (sal_Int32 i = 0; i < nLen; ++i, ++pToken) + m_aListSource += *pToken; + } + + sal_Int16 nValue; + _rxInStream >> nValue; + m_eListSourceType = (ListSourceType)nValue; + + if ((nAnyMask & BOUNDCOLUMN) == BOUNDCOLUMN) + { + sal_Int16 nLclValue; + _rxInStream >> nLclValue; + m_aBoundColumn <<= nLclValue; + } + + if (nVersion > 0x0001) + { + sal_Bool bNull; + _rxInStream >> bNull; + m_bEmptyIsNull = bNull; + } + + if (nVersion > 0x0003) // nVersion == 4 + _rxInStream >> m_aDefaultText; + + // Stringliste muss geleert werden, wenn eine Listenquelle gesetzt ist + // dieses kann der Fall sein wenn im alive modus gespeichert wird + if (m_aListSource.getLength() && m_xAggregateSet.is()) + { + StringSequence aSequence; + m_xAggregateSet->setPropertyValue(PROPERTY_STRINGITEMLIST, makeAny(aSequence)); + } + + if (nVersion > 0x0004) + readHelpTextCompatibly(_rxInStream); + + if (nVersion > 0x0005) + readCommonProperties(_rxInStream); + + // Nach dem Lesen die Defaultwerte anzeigen + if (m_aControlSource.getLength()) + { + // (not if we don't have a control source - the "State" property acts like it is persistent, then + //_reset(); + } +} + +//------------------------------------------------------------------------------ +void OComboBoxModel::loadData() +{ + OSL_ENSURE( false, "OComboBoxModel::loadData: dead code!?" ); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OComboBoxModel::reloaded( const EventObject& /*rEvent*/ ) throw(RuntimeException) +{ + OSL_ENSURE( false, "OComboBoxModel::reloaded: dead code!?" ); +} + +//======================================================================== +//= OComboBoxControl +//======================================================================== + +//------------------------------------------------------------------ +InterfaceRef SAL_CALL OComboBoxControl_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) +{ + return *(new OComboBoxControl(_rxFactory)); +} + +//------------------------------------------------------------------------------ +OComboBoxControl::OComboBoxControl(const Reference& _rxFactory) + :OBoundControl(_rxFactory, VCL_CONTROL_COMBOBOX) +{ +} + +//------------------------------------------------------------------------------ +StringSequence SAL_CALL OComboBoxControl::getSupportedServiceNames() throw(RuntimeException) +{ + StringSequence aSupported = OBoundControl::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 1); + + ::rtl::OUString* pArray = aSupported.getArray(); + pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_COMBOBOX; + return aSupported; +} + +//......................................................................... +} +//......................................................................... + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/forms_Currency.cxx b/bf_forms/source/component/forms_Currency.cxx new file mode 100644 index 00000000000..cebbda1c0b8 --- /dev/null +++ b/bf_forms/source/component/forms_Currency.cxx @@ -0,0 +1,240 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include "Currency.hxx" +#include +#include "services.hxx" +#include +#include + +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::util; + +//================================================================== +// OCurrencyControl +//================================================================== +//------------------------------------------------------------------ +OCurrencyControl::OCurrencyControl(const Reference& _rxFactory) + :OBoundControl(_rxFactory, VCL_CONTROL_CURRENCYFIELD) +{ +} + +//------------------------------------------------------------------ +InterfaceRef SAL_CALL OCurrencyControl_CreateInstance(const Reference& _rxFactory) +{ + return *(new OCurrencyControl(_rxFactory)); +} + +//------------------------------------------------------------------------------ +Sequence OCurrencyControl::_getTypes() +{ + return OBoundControl::_getTypes(); +} + +//------------------------------------------------------------------------------ +StringSequence SAL_CALL OCurrencyControl::getSupportedServiceNames() throw() +{ + StringSequence aSupported = OBoundControl::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 1); + + ::rtl::OUString*pArray = aSupported.getArray(); + pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_CURRENCYFIELD; + return aSupported; +} + +//================================================================== +// OCurrencyModel +//================================================================== +sal_Int32 OCurrencyModel::nValueHandle = -1; + +//------------------------------------------------------------------ +InterfaceRef SAL_CALL OCurrencyModel_CreateInstance(const Reference& _rxFactory) +{ + return *(new OCurrencyModel(_rxFactory)); +} + +//------------------------------------------------------------------------------ +Sequence OCurrencyModel::_getTypes() +{ + return OEditBaseModel::_getTypes(); +} + +//------------------------------------------------------------------ +void OCurrencyModel::implConstruct() +{ + if (m_xAggregateSet.is()) + { + try + { + // get the system international informations + const LocaleDataWrapper& aLocaleInfo = SvtSysLocale().GetLocaleData(); + + ::rtl::OUString sCurrencySymbol; + sal_Bool bPrependCurrencySymbol; + switch ( aLocaleInfo.getCurrPositiveFormat() ) + { + case 0: // $1 + sCurrencySymbol = String(aLocaleInfo.getCurrSymbol()); + bPrependCurrencySymbol = sal_True; + break; + case 1: // 1$ + sCurrencySymbol = String(aLocaleInfo.getCurrSymbol()); + bPrependCurrencySymbol = sal_False; + break; + case 2: // $ 1 + sCurrencySymbol = ::rtl::OUString(String(aLocaleInfo.getCurrSymbol())) + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )); + bPrependCurrencySymbol = sal_True; + break; + case 3: // 1 $ + sCurrencySymbol = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )) + ::rtl::OUString(String(aLocaleInfo.getCurrSymbol())); + bPrependCurrencySymbol = sal_False; + break; + } + if (sCurrencySymbol.getLength()) + { + m_xAggregateSet->setPropertyValue(PROPERTY_CURRENCYSYMBOL, makeAny(sCurrencySymbol)); + m_xAggregateSet->setPropertyValue(PROPERTY_CURRSYM_POSITION, makeAny(bPrependCurrencySymbol)); + } + } + catch(Exception&) + { + OSL_FAIL( "OCurrencyModel::implConstruct: caught an exception while initializing the aggregate!" ); + } + } +} + +//------------------------------------------------------------------ +DBG_NAME( OCurrencyModel ) +//------------------------------------------------------------------ +OCurrencyModel::OCurrencyModel(const Reference& _rxFactory) + :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_CURRENCYFIELD, FRM_CONTROL_CURRENCYFIELD) + // use the old control name for compytibility reasons +{ + DBG_CTOR( OCurrencyModel, NULL ); + + m_nClassId = FormComponentType::CURRENCYFIELD; + m_sDataFieldConnectivityProperty = PROPERTY_VALUE; + if (OCurrencyModel::nValueHandle == -1) + OCurrencyModel::nValueHandle = getOriginalHandle(PROPERTY_ID_VALUE); + + implConstruct(); +} + +//------------------------------------------------------------------ +OCurrencyModel::OCurrencyModel( const OCurrencyModel* _pOriginal, const Reference& _rxFactory ) + :OEditBaseModel( _pOriginal, _rxFactory ) +{ + DBG_CTOR( OCurrencyModel, NULL ); + implConstruct(); +} + +//------------------------------------------------------------------ +OCurrencyModel::~OCurrencyModel() +{ + DBG_DTOR( OCurrencyModel, NULL ); +} + +// XCloneable +//------------------------------------------------------------------------------ +IMPLEMENT_DEFAULT_CLONING( OCurrencyModel ) + +// XServiceInfo +//------------------------------------------------------------------------------ +StringSequence SAL_CALL OCurrencyModel::getSupportedServiceNames() throw() +{ + StringSequence aSupported = OBoundControlModel::getSupportedServiceNames(); + aSupported.realloc(aSupported.getLength() + 2); + + ::rtl::OUString*pArray = aSupported.getArray(); + pArray[aSupported.getLength()-2] = FRM_SUN_COMPONENT_DATABASE_CURRENCYFIELD; + pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_CURRENCYFIELD; + return aSupported; +} + +//------------------------------------------------------------------------------ +Reference SAL_CALL OCurrencyModel::getPropertySetInfo() throw( RuntimeException ) +{ + Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; +} + +//------------------------------------------------------------------------------ +void OCurrencyModel::fillProperties( + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const +{ + FRM_BEGIN_PROP_HELPER(9) + // Value auf transient setzen +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_VALUE, PropertyAttribute::TRANSIENT, 0); + + DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); + DECL_PROP3(DEFAULT_VALUE, double, BOUND, MAYBEDEFAULT, MAYBEVOID); + DECL_PROP1(NAME, ::rtl::OUString, BOUND); + DECL_PROP1(TAG, ::rtl::OUString, BOUND); + DECL_PROP1(TABINDEX, sal_Int16, BOUND); + DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); + DECL_IFACE_PROP3(BOUNDFIELD, XPropertySet, BOUND,READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); + DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); + FRM_END_PROP_HELPER(); +} + +//------------------------------------------------------------------------------ +::cppu::IPropertyArrayHelper& OCurrencyModel::getInfoHelper() +{ + return *const_cast(this)->getArrayHelper(); +} + +//------------------------------------------------------------------------------ +::rtl::OUString SAL_CALL OCurrencyModel::getServiceName() throw ( ::com::sun::star::uno::RuntimeException) +{ + return FRM_COMPONENT_CURRENCYFIELD; // old (non-sun) name for compatibility ! +} + +//......................................................................... +} // namespace frm +//......................................................................... + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/component/forms_DatabaseForm.cxx b/bf_forms/source/component/forms_DatabaseForm.cxx new file mode 100644 index 00000000000..bdd57dfb0c8 --- /dev/null +++ b/bf_forms/source/component/forms_DatabaseForm.cxx @@ -0,0 +1,3867 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include + +#include "DatabaseForm.hxx" +#include "EventThread.hxx" +#include "ListBox.hxx" +#include "frm_resource.hxx" +#include "frm_resource.hrc" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GroupManager.hxx" + +#include "property.hrc" +#include "services.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "formsmodule.hxx" + +#include + +#include + +// compatiblity: DatabaseCursorType is dead, but for compatiblity reasons we still have to write it ... +namespace com { +namespace sun { +namespace star { +namespace data { + +enum DatabaseCursorType +{ + DatabaseCursorType_FORWARD = 0, + DatabaseCursorType_SNAPSHOT = 1, + DatabaseCursorType_KEYSET = 2, + DatabaseCursorType_DYNAMIC = 3, + DatabaseCursorType_MAKE_FIXED_SIZE = SAL_MAX_ENUM +}; + +} } } } + +#include +#include +#include +#include "bf_so3/staticbaseurl.hxx" +namespace binfilter { + +#define DATABASEFORM_IMPLEMENTATION_NAME ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.forms.ODatabaseForm" )) + +using namespace ::dbtools; +using namespace ::comphelper; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::task; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::data; +using namespace ::com::sun::star::util; + +//-------------------------------------------------------------------------- +extern "C" void SAL_CALL createRegistryInfo_ODatabaseForm() +{ + static ::binfilter::frm::OMultiInstanceAutoRegistration< ::binfilter::frm::ODatabaseForm > aAutoRegistration; +} + +//......................................................................... +namespace frm +{ +//......................................................................... + + +//------------------------------------------------------------------ +Reference< XModel> getXModel(const Reference< XInterface>& xIface) +{ + Reference< XModel> xModel(xIface, UNO_QUERY); + if (xModel.is()) + return xModel; + else + { + Reference< XChild> xChild(xIface, UNO_QUERY); + if (xChild.is()) + { + Reference< XInterface> xParent( xChild->getParent()); + return getXModel(xParent); + } + else + return NULL; + } +} + +//================================================================== +// OParameterContinuation +//================================================================== +class OParameterContinuation : public OInteraction< XInteractionSupplyParameters > +{ + Sequence< PropertyValue > m_aValues; + +public: + OParameterContinuation() { } + + Sequence< PropertyValue > getValues() const { return m_aValues; } + +// XInteractionSupplyParameters + virtual void SAL_CALL setParameters( const Sequence< PropertyValue >& _rValues ) throw(RuntimeException); +}; + +//------------------------------------------------------------------ +void SAL_CALL OParameterContinuation::setParameters( const Sequence< PropertyValue >& _rValues ) throw(RuntimeException) +{ + m_aValues = _rValues; +} + +//================================================================== +//= OParametersImpl +//=----------------------------------------------------------------- +//= class for the parameter event see approveParameter +//================================================================== + +typedef ::cppu::WeakImplHelper2 OParametersImplBase; +class OParametersImpl : public OParametersImplBase +{ +public: + typedef ::std::vector > Parameters; + typedef Parameters::iterator ParametersIterator; + +private: + Parameters m_aParameters; + +protected: + virtual ~OParametersImpl(){} +public: + // UNO + DECLARE_UNO3_AGG_DEFAULTS(OParametersImpl, OParametersImplBase); + + // XElementAccess + virtual Type SAL_CALL getElementType() throw( RuntimeException ); + virtual sal_Bool SAL_CALL hasElements() throw( RuntimeException ); + + // XEnumerationAccess + virtual Reference SAL_CALL createEnumeration() throw( RuntimeException ); + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() throw( RuntimeException ); + virtual Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); + + Parameters& getParameters() { return m_aParameters; } +}; + +// XElementAccess +//------------------------------------------------------------------------------ +Type SAL_CALL OParametersImpl::getElementType() throw( RuntimeException ) +{ + return ::getCppuType(static_cast*>(NULL)); +} + +//------------------------------------------------------------------------------ +sal_Bool SAL_CALL OParametersImpl::hasElements() throw( RuntimeException ) +{ + return !m_aParameters.empty(); +} + +// XIndexAccess +//------------------------------------------------------------------------------ +sal_Int32 SAL_CALL OParametersImpl::getCount() throw( RuntimeException ) +{ + return m_aParameters.size(); +} + +//------------------------------------------------------------------------------ +Any SAL_CALL OParametersImpl::getByIndex(sal_Int32 _nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException ) +{ + if ((_nIndex < 0) || (_nIndex >= (sal_Int32)m_aParameters.size())) + throw IndexOutOfBoundsException(); + + return makeAny(m_aParameters[_nIndex]); +} + +// XEnumerationAccess +//------------------------------------------------------------------------------ +Reference OParametersImpl::createEnumeration() throw( RuntimeException ) +{ + return new OEnumerationByIndex(reinterpret_cast(this)); +} + +//================================================================== +//= OParameterInfoImpl +//=----------------------------------------------------------------- +//= class which collects all information for parameter filling +//================================================================== +typedef ::std::multimap< ::rtl::OUString,sal_Int32,::comphelper::UStringLess > MapUString2INT32; + +struct OParameterInfoImpl +{ + sal_Int32 nCount; // Number of Parameters + Reference xComposer; + Reference xParamsAsIndex; + OParametersImpl* pParameters; + MapUString2INT32 aParamMapping; + + OParameterInfoImpl():nCount(0),pParameters(NULL){} + ~OParameterInfoImpl() + { + if (pParameters) + pParameters->release(); + } +}; + +//================================================================== +//= OFormSubmitResetThread +//=----------------------------------------------------------------- +//= submitting and resetting html-forms asynchronously +//================================================================== + +//------------------------------------------------------------------ +class OFormSubmitResetThread: public OComponentEventThread +{ +protected: + + // duplicate an event with respect to it's type + virtual EventObject *cloneEvent( const EventObject *pEvt ) const; + + // process an event. while processing the mutex isn't locked, and pCompImpl + // is made sure to remain valid + virtual void processEvent( ::cppu::OComponentHelper* _pCompImpl, + const EventObject* _pEvt, + const Reference& _rControl, + sal_Bool _bSubmit); + +public: + + OFormSubmitResetThread(ODatabaseForm* pControl) : OComponentEventThread(pControl) { } +}; + +//------------------------------------------------------------------ +EventObject* OFormSubmitResetThread::cloneEvent( + const EventObject *pEvt ) const +{ + return new ::com::sun::star::awt::MouseEvent( *(::com::sun::star::awt::MouseEvent *)pEvt ); +} + +//------------------------------------------------------------------ +void OFormSubmitResetThread::processEvent( + ::cppu::OComponentHelper* pCompImpl, + const EventObject *_pEvt, + const Reference& _rControl, + sal_Bool _bSubmit) +{ + if (_bSubmit) + ((ODatabaseForm *)pCompImpl)->submit_impl(_rControl, *reinterpret_cast(_pEvt), true); + else + ((ODatabaseForm *)pCompImpl)->reset_impl(true); +} + +//================================================================== +//= ODatabaseForm +//================================================================== + +//------------------------------------------------------------------ +Reference< XInterface > SAL_CALL ODatabaseForm::Create( const Reference< XMultiServiceFactory >& _rxFactory ) +{ + return *( new ODatabaseForm( _rxFactory ) ); +} + +//------------------------------------------------------------------------------ +Sequence SAL_CALL ODatabaseForm::getImplementationId() throw(RuntimeException) +{ + return OImplementationIds::getImplementationId(getTypes()); +} + +//------------------------------------------------------------------ +Sequence SAL_CALL ODatabaseForm::getTypes() throw(RuntimeException) +{ + // ask the aggregate + Sequence aAggregateTypes; + Reference xAggregateTypes; + if (query_aggregation(m_xAggregate, xAggregateTypes)) + aAggregateTypes = xAggregateTypes->getTypes(); + + Sequence aRet = concatSequences(aAggregateTypes, ODatabaseForm_BASE1::getTypes(), OFormComponents::getTypes()); + return concatSequences(aRet,ODatabaseForm_BASE2::getTypes(), ODatabaseForm_BASE3::getTypes()); +} + +//------------------------------------------------------------------ +Any SAL_CALL ODatabaseForm::queryAggregation(const Type& _rType) throw(RuntimeException) +{ + Any aReturn = ODatabaseForm_BASE1::queryInterface(_rType); + // our own interfaces + if (!aReturn.hasValue()) + { + aReturn = ODatabaseForm_BASE2::queryInterface(_rType); + // property set related interfaces + if (!aReturn.hasValue()) + { + aReturn = OPropertySetAggregationHelper::queryInterface(_rType); + + // form component collection related interfaces + if (!aReturn.hasValue()) + { + aReturn = OFormComponents::queryAggregation(_rType); + + // interfaces already present in the aggregate which we want to reroute + // only available if we could create the aggregate + if (!aReturn.hasValue() && m_xAggregateAsRowSet.is()) + aReturn = ODatabaseForm_BASE3::queryInterface(_rType); + + // aggregate interfaces + // (ask the aggregated object _after_ the OComponentHelper (base of OFormComponents), + // so calls to the XComponent interface reach us and not the aggreagtion) + if (!aReturn.hasValue() && m_xAggregate.is()) + aReturn = m_xAggregate->queryAggregation(_rType); + } + } + } + + return aReturn; +} + +DBG_NAME(ODatabaseForm) +//------------------------------------------------------------------ +ODatabaseForm::ODatabaseForm(const Reference& _rxFactory) + :OFormComponents(_rxFactory) + ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) + ,OPropertyChangeListener(m_aMutex) + ,m_aLoadListeners(m_aMutex) + ,m_aRowSetApproveListeners(m_aMutex) + ,m_aRowSetListeners(m_aMutex) + ,m_aParameterListeners(m_aMutex) + ,m_aResetListeners(m_aMutex) + ,m_aSubmitListeners(m_aMutex) + ,m_aErrorListeners(m_aMutex) + ,m_pAggregatePropertyMultiplexer(NULL) + ,m_pParameterInfo(NULL) + ,m_pLoadTimer(NULL) + ,m_pThread(NULL) + ,m_nResetsPending(0) + ,m_nPrivileges(0) + ,m_eSubmitMethod(FormSubmitMethod_GET) + ,m_eSubmitEncoding(FormSubmitEncoding_URL) + ,m_eNavigation(NavigationBarMode_CURRENT) + ,m_bAllowInsert(sal_True) + ,m_bAllowUpdate(sal_True) + ,m_bAllowDelete(sal_True) + ,m_bLoaded(sal_False) + ,m_bSubForm(sal_False) + ,m_bForwardingConnection(sal_False) + ,m_bSharingConnection( sal_False ) +{ + DBG_CTOR(ODatabaseForm,NULL); + + // aggregate a row set + increment(m_refCount); + + { + m_xAggregate = Reference(m_xServiceFactory->createInstance(SRV_SDB_ROWSET), UNO_QUERY); + DBG_ASSERT(m_xAggregate.is(), "ODatabaseForm::ODatabaseForm : could not instantiate an SDB rowset !"); + m_xAggregateAsRowSet = Reference (m_xAggregate,UNO_QUERY); + setAggregation(m_xAggregate); + } + + // listen for the properties, important for Parameters + if (m_xAggregateSet.is()) + { + m_pAggregatePropertyMultiplexer = new OPropertyChangeMultiplexer(this, m_xAggregateSet, sal_False); + m_pAggregatePropertyMultiplexer->acquire(); + m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_COMMAND); + m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_FILTER_CRITERIA); + m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_APPLYFILTER); + m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_ACTIVE_CONNECTION); + } + + if (m_xAggregate.is()) + { + m_xAggregate->setDelegator(static_cast(this)); + } + + decrement(m_refCount); + + m_pGroupManager = new OGroupManager(this); + m_pGroupManager->acquire(); +} + +//------------------------------------------------------------------ +ODatabaseForm::~ODatabaseForm() +{ + DBG_DTOR(ODatabaseForm,NULL); + + m_pGroupManager->release(); + + if (m_xAggregate.is()) + m_xAggregate->setDelegator(InterfaceRef()); + + if (m_pAggregatePropertyMultiplexer) + { + m_pAggregatePropertyMultiplexer->dispose(); + m_pAggregatePropertyMultiplexer->release(); + m_pAggregatePropertyMultiplexer = NULL; + } +} + +//============================================================================== +// html tools +//------------------------------------------------------------------------ +::rtl::OUString ODatabaseForm::GetDataURLEncoded(const Reference& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt) +{ + + // Liste von successful Controls fuellen + HtmlSuccessfulObjList aSuccObjList; + FillSuccessfulList( aSuccObjList, SubmitButton, MouseEvt ); + + + // Liste zu ::rtl::OUString zusammensetzen + ::rtl::OUString aResult; + ::rtl::OUString aName; + ::rtl::OUString aValue; + + for ( HtmlSuccessfulObjListIterator pSuccObj = aSuccObjList.begin(); + pSuccObj < aSuccObjList.end(); + ++pSuccObj + ) + { + aName = pSuccObj->aName; + aValue = pSuccObj->aValue; + if( pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE && aValue.getLength() ) + { + // Bei File-URLs wird der Dateiname und keine URL uebertragen, + // weil Netscape dies so macht. + INetURLObject aURL; + aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartURL(aValue); + if( INET_PROT_FILE == aURL.GetProtocol() ) + aValue = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); + } + Encode( aName ); + Encode( aValue ); + aResult += aName; + aResult += UniString('='); + aResult += aValue; + if (pSuccObj < aSuccObjList.end() - 1) + aResult += UniString('&'); + } + + + aSuccObjList.clear(); + + return aResult; +} + +//============================================================================== +// html tools +//------------------------------------------------------------------------ +::rtl::OUString ODatabaseForm::GetDataTextEncoded(const Reference& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt) +{ + + // Liste von successful Controls fuellen + HtmlSuccessfulObjList aSuccObjList; + FillSuccessfulList( aSuccObjList, SubmitButton, MouseEvt ); + // Liste zu ::rtl::OUString zusammensetzen + ::rtl::OUString aResult; + ::rtl::OUString aName; + ::rtl::OUString aValue; + + for ( HtmlSuccessfulObjListIterator pSuccObj = aSuccObjList.begin(); + pSuccObj < aSuccObjList.end(); + ++pSuccObj + ) + { + aName = pSuccObj->aName; + aValue = pSuccObj->aValue; + if (pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE && aValue.getLength()) + { + // Bei File-URLs wird der Dateiname und keine URL uebertragen, + // weil Netscape dies so macht. + INetURLObject aURL; + aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartURL(aValue); + if( INET_PROT_FILE == aURL.GetProtocol() ) + aValue = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); + } + Encode( aName ); + Encode( aValue ); + aResult += pSuccObj->aName; + aResult += UniString('='); + aResult += pSuccObj->aValue; + if (pSuccObj < aSuccObjList.end() - 1) + aResult += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\r\n" )); + } + + + // Liste loeschen + aSuccObjList.clear(); + + return aResult; +} + +//------------------------------------------------------------------------ +Sequence ODatabaseForm::GetDataMultiPartEncoded(const Reference& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt, ::rtl::OUString& rContentType) +{ + + // Parent erzeugen + INetMIMEMessage aParent; + aParent.EnableAttachChild( INETMSG_MULTIPART_FORM_DATA ); + + + // Liste von successful Controls fuellen + HtmlSuccessfulObjList aSuccObjList; + FillSuccessfulList( aSuccObjList, SubmitButton, MouseEvt ); + + + // Liste zu ::rtl::OUString zusammensetzen + ::rtl::OUString aResult; + for ( HtmlSuccessfulObjListIterator pSuccObj = aSuccObjList.begin(); + pSuccObj < aSuccObjList.end(); + ++pSuccObj + ) + { + if( pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_TEXT ) + InsertTextPart( aParent, pSuccObj->aName, pSuccObj->aValue ); + else if( pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE ) + InsertFilePart( aParent, pSuccObj->aName, pSuccObj->aValue ); + } + + + // Liste loeschen + aSuccObjList.clear(); + + // Fuer Parent MessageStream erzeugen + INetMIMEMessageStream aMessStream; + aMessStream.SetSourceMessage( &aParent ); + aMessStream.GenerateHeader( sal_False ); + + // MessageStream in SvStream kopieren + SvMemoryStream aMemStream; + char* pBuf = new char[1025]; + int nRead; + while( (nRead = aMessStream.Read(pBuf, 1024)) > 0 ) + aMemStream.Write( pBuf, nRead ); + delete[] pBuf; + + aMemStream.Flush(); + aMemStream.Seek( 0 ); + void* pData = (void*)aMemStream.GetData(); + sal_Int32 nLen = aMemStream.Seek(STREAM_SEEK_TO_END); + + rContentType = UniString(aParent.GetContentType()); + return Sequence((sal_Int8*)pData, nLen); +} + +//------------------------------------------------------------------------ +void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Reference& xComponentSet, const ::rtl::OUString& rNamePrefix, + const Reference& rxSubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt) +{ + if (!xComponentSet.is()) + return; + + // MIB 25.6.98: Geschachtelte Formulare abfangen ... oder muesste + // man sie submitten? + if (!hasProperty(PROPERTY_CLASSID, xComponentSet)) + return; + + // Namen ermitteln + if (!hasProperty(PROPERTY_NAME, xComponentSet)) + return; + + sal_Int16 nClassId(0); + xComponentSet->getPropertyValue(PROPERTY_CLASSID) >>= nClassId; + ::rtl::OUString aName; + xComponentSet->getPropertyValue( PROPERTY_NAME ) >>= aName; + if( !aName.getLength() && nClassId != FormComponentType::IMAGEBUTTON) + return; + else // Name um den Prefix erweitern + aName = rNamePrefix + aName; + + switch( nClassId ) + { + // Buttons + case FormComponentType::COMMANDBUTTON: + { + // Es wird nur der gedrueckte Submit-Button ausgewertet + // MIB: Sofern ueberhaupt einer uebergeben wurde + if( rxSubmitButton.is() ) + { + Reference xSubmitButtonComponent(rxSubmitButton->getModel(), UNO_QUERY); + if (xSubmitButtonComponent == xComponentSet && hasProperty(PROPERTY_LABEL, xComponentSet)) + { + // =